Skip to content

Commit 28cfbdd

Browse files
committed
Add 1.8.x support
1 parent 56bcd31 commit 28cfbdd

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

Sources/Appwrite/Services/Databases.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,21 @@ open class Databases: Service {
5353
/// - databaseId: String
5454
/// - name: String
5555
/// - enabled: Bool (optional)
56-
/// - type: AppwriteEnums.Type (optional)
5756
/// - Throws: Exception if the request fails
5857
/// - Returns: AppwriteModels.Database
5958
///
6059
@available(*, deprecated, message: "This API has been deprecated since 1.8.0. Please use `TablesDb.createDatabase` instead.")
6160
open func create(
6261
databaseId: String,
6362
name: String,
64-
enabled: Bool? = nil,
65-
type: AppwriteEnums.Type? = nil
63+
enabled: Bool? = nil
6664
) async throws -> AppwriteModels.Database {
6765
let apiPath: String = "/databases"
6866

6967
let apiParams: [String: Any?] = [
7068
"databaseId": databaseId,
7169
"name": name,
72-
"enabled": enabled,
73-
"type": type
70+
"enabled": enabled
7471
]
7572

7673
let apiHeaders: [String: String] = [

Sources/Appwrite/Services/TablesDb.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,20 @@ open class TablesDb: Service {
5252
/// - databaseId: String
5353
/// - name: String
5454
/// - enabled: Bool (optional)
55-
/// - type: AppwriteEnums.Type (optional)
5655
/// - Throws: Exception if the request fails
5756
/// - Returns: AppwriteModels.Database
5857
///
5958
open func create(
6059
databaseId: String,
6160
name: String,
62-
enabled: Bool? = nil,
63-
type: AppwriteEnums.Type? = nil
61+
enabled: Bool? = nil
6462
) async throws -> AppwriteModels.Database {
6563
let apiPath: String = "/tablesdb"
6664

6765
let apiParams: [String: Any?] = [
6866
"databaseId": databaseId,
6967
"name": name,
70-
"enabled": enabled,
71-
"type": type
68+
"enabled": enabled
7269
]
7370

7471
let apiHeaders: [String: String] = [
@@ -1549,7 +1546,7 @@ open class TablesDb: Service {
15491546
}
15501547

15511548
///
1552-
/// List indexes in the collection.
1549+
/// List indexes on the table.
15531550
///
15541551
/// - Parameters:
15551552
/// - databaseId: String
@@ -1589,7 +1586,7 @@ open class TablesDb: Service {
15891586
///
15901587
/// Creates an index on the columns listed. Your index should include all the
15911588
/// columns you will query in a single request.
1592-
/// Attributes can be `key`, `fulltext`, and `unique`.
1589+
/// Type can be `key`, `fulltext`, or `unique`.
15931590
///
15941591
/// - Parameters:
15951592
/// - databaseId: String

Sources/AppwriteEnums/Type.swift

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/examples/databases/create.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Appwrite
2-
import AppwriteEnums
32

43
let client = Client()
54
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@@ -11,7 +10,6 @@ let databases = Databases(client)
1110
let database = try await databases.create(
1211
databaseId: "<DATABASE_ID>",
1312
name: "<NAME>",
14-
enabled: false, // optional
15-
type: .tablesdb // optional
13+
enabled: false // optional
1614
)
1715

docs/examples/tablesdb/create.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Appwrite
2-
import AppwriteEnums
32

43
let client = Client()
54
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@@ -11,7 +10,6 @@ let tablesDb = TablesDb(client)
1110
let database = try await tablesDb.create(
1211
databaseId: "<DATABASE_ID>",
1312
name: "<NAME>",
14-
enabled: false, // optional
15-
type: .tablesdb // optional
13+
enabled: false // optional
1614
)
1715

0 commit comments

Comments
 (0)