Skip to content

Commit af4e893

Browse files
authored
Merge pull request #59 from appwrite/dev
feat: Kotlin SDK update for version 12.2.0
2 parents 79f3cee + 8419270 commit af4e893

File tree

83 files changed

+1223
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1223
-33
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## 12.2.0
4+
5+
* Add transaction support for Databases and TablesDB
6+
37
## 12.1.0
48

59
* Deprecate `createVerification` method in `Account` service

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repositories {
3939
Next, add the dependency to your project's `build.gradle(.kts)` file:
4040

4141
```groovy
42-
implementation("io.appwrite:sdk-for-kotlin:12.1.0")
42+
implementation("io.appwrite:sdk-for-kotlin:12.2.0")
4343
```
4444

4545
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
5050
<dependency>
5151
<groupId>io.appwrite</groupId>
5252
<artifactId>sdk-for-kotlin</artifactId>
53-
<version>12.1.0</version>
53+
<version>12.2.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/databases/create-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ databases.createDocument(
2121
"isAdmin" to false
2222
), // data
2323
listOf("read("any")"), // permissions (optional)
24+
"<TRANSACTION_ID>", // transactionId (optional)
2425
new CoroutineCallback<>((result, error) -> {
2526
if (error != null) {
2627
error.printStackTrace();

docs/examples/java/databases/create-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ databases.createDocuments(
1313
"<DATABASE_ID>", // databaseId
1414
"<COLLECTION_ID>", // collectionId
1515
listOf(), // documents
16+
"<TRANSACTION_ID>", // transactionId (optional)
1617
new CoroutineCallback<>((result, error) -> {
1718
if (error != null) {
1819
error.printStackTrace();
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.createOperations(
13+
"<TRANSACTION_ID>", // transactionId
14+
listOf(
15+
{
16+
"action": "create",
17+
"databaseId": "<DATABASE_ID>",
18+
"collectionId": "<COLLECTION_ID>",
19+
"documentId": "<DOCUMENT_ID>",
20+
"data": {
21+
"name": "Walter O'Brien"
22+
}
23+
}
24+
), // operations (optional)
25+
new CoroutineCallback<>((result, error) -> {
26+
if (error != null) {
27+
error.printStackTrace();
28+
return;
29+
}
30+
31+
System.out.println(result);
32+
})
33+
);
34+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.createTransaction(
13+
60, // ttl (optional)
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+

docs/examples/java/databases/decrement-document-attribute.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ databases.decrementDocumentAttribute(
1616
"", // attribute
1717
0, // value (optional)
1818
0, // min (optional)
19+
"<TRANSACTION_ID>", // transactionId (optional)
1920
new CoroutineCallback<>((result, error) -> {
2021
if (error != null) {
2122
error.printStackTrace();

docs/examples/java/databases/delete-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ databases.deleteDocument(
1313
"<DATABASE_ID>", // databaseId
1414
"<COLLECTION_ID>", // collectionId
1515
"<DOCUMENT_ID>", // documentId
16+
"<TRANSACTION_ID>", // transactionId (optional)
1617
new CoroutineCallback<>((result, error) -> {
1718
if (error != null) {
1819
error.printStackTrace();

docs/examples/java/databases/delete-documents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ databases.deleteDocuments(
1313
"<DATABASE_ID>", // databaseId
1414
"<COLLECTION_ID>", // collectionId
1515
listOf(), // queries (optional)
16+
"<TRANSACTION_ID>", // transactionId (optional)
1617
new CoroutineCallback<>((result, error) -> {
1718
if (error != null) {
1819
error.printStackTrace();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Databases;
4+
5+
Client client = new Client()
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
.setKey("<YOUR_API_KEY>"); // Your secret API key
9+
10+
Databases databases = new Databases(client);
11+
12+
databases.deleteTransaction(
13+
"<TRANSACTION_ID>", // transactionId
14+
new CoroutineCallback<>((result, error) -> {
15+
if (error != null) {
16+
error.printStackTrace();
17+
return;
18+
}
19+
20+
System.out.println(result);
21+
})
22+
);
23+

0 commit comments

Comments
 (0)