diff --git a/CHANGELOG.md b/CHANGELOG.md
index b6b9e40..559b61f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 11.2.0
+
+* Add transaction support for Databases and TablesDB
+
## 11.1.0
* Deprecate `createVerification` method in `Account` service
diff --git a/README.md b/README.md
index bd59ff0..79b38e4 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
-implementation("io.appwrite:sdk-for-android:11.1.0")
+implementation("io.appwrite:sdk-for-android:11.2.0")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
io.appwrite
sdk-for-android
- 11.1.0
+ 11.2.0
```
diff --git a/docs/examples/java/databases/create-document.md b/docs/examples/java/databases/create-document.md
index bd0b57a..694d99a 100644
--- a/docs/examples/java/databases/create-document.md
+++ b/docs/examples/java/databases/create-document.md
@@ -20,6 +20,7 @@ databases.createDocument(
"isAdmin" to false
), // data
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/create-operations.md b/docs/examples/java/databases/create-operations.md
new file mode 100644
index 0000000..def58af
--- /dev/null
+++ b/docs/examples/java/databases/create-operations.md
@@ -0,0 +1,33 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.createOperations(
+ "", // transactionId
+ listOf(
+ {
+ "action": "create",
+ "databaseId": "",
+ "collectionId": "",
+ "documentId": "",
+ "data": {
+ "name": "Walter O'Brien"
+ }
+ }
+ ), // operations (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/create-transaction.md b/docs/examples/java/databases/create-transaction.md
new file mode 100644
index 0000000..871d190
--- /dev/null
+++ b/docs/examples/java/databases/create-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.createTransaction(
+ 60, // ttl (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/decrement-document-attribute.md b/docs/examples/java/databases/decrement-document-attribute.md
index de6a4ab..8669494 100644
--- a/docs/examples/java/databases/decrement-document-attribute.md
+++ b/docs/examples/java/databases/decrement-document-attribute.md
@@ -15,6 +15,7 @@ databases.decrementDocumentAttribute(
"", // attribute
0, // value (optional)
0, // min (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/delete-document.md b/docs/examples/java/databases/delete-document.md
index 5288e53..2795670 100644
--- a/docs/examples/java/databases/delete-document.md
+++ b/docs/examples/java/databases/delete-document.md
@@ -12,6 +12,7 @@ databases.deleteDocument(
"", // databaseId
"", // collectionId
"", // documentId
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/delete-transaction.md b/docs/examples/java/databases/delete-transaction.md
new file mode 100644
index 0000000..ac1121e
--- /dev/null
+++ b/docs/examples/java/databases/delete-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.deleteTransaction(
+ "", // transactionId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/get-document.md b/docs/examples/java/databases/get-document.md
index e7ae207..92d6b5e 100644
--- a/docs/examples/java/databases/get-document.md
+++ b/docs/examples/java/databases/get-document.md
@@ -13,6 +13,7 @@ databases.getDocument(
"", // collectionId
"", // documentId
listOf(), // queries (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/get-transaction.md b/docs/examples/java/databases/get-transaction.md
new file mode 100644
index 0000000..5dee850
--- /dev/null
+++ b/docs/examples/java/databases/get-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.getTransaction(
+ "", // transactionId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/increment-document-attribute.md b/docs/examples/java/databases/increment-document-attribute.md
index 94ffa9d..5928b45 100644
--- a/docs/examples/java/databases/increment-document-attribute.md
+++ b/docs/examples/java/databases/increment-document-attribute.md
@@ -15,6 +15,7 @@ databases.incrementDocumentAttribute(
"", // attribute
0, // value (optional)
0, // max (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/list-documents.md b/docs/examples/java/databases/list-documents.md
index 606d677..7b2ba23 100644
--- a/docs/examples/java/databases/list-documents.md
+++ b/docs/examples/java/databases/list-documents.md
@@ -12,6 +12,7 @@ databases.listDocuments(
"", // databaseId
"", // collectionId
listOf(), // queries (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/list-transactions.md b/docs/examples/java/databases/list-transactions.md
new file mode 100644
index 0000000..39f58f3
--- /dev/null
+++ b/docs/examples/java/databases/list-transactions.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.listTransactions(
+ listOf(), // queries (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/update-document.md b/docs/examples/java/databases/update-document.md
index baa827c..a6103e4 100644
--- a/docs/examples/java/databases/update-document.md
+++ b/docs/examples/java/databases/update-document.md
@@ -14,6 +14,7 @@ databases.updateDocument(
"", // documentId
mapOf( "a" to "b" ), // data (optional)
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/databases/update-transaction.md b/docs/examples/java/databases/update-transaction.md
new file mode 100644
index 0000000..c5f586f
--- /dev/null
+++ b/docs/examples/java/databases/update-transaction.md
@@ -0,0 +1,24 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.Databases;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+Databases databases = new Databases(client);
+
+databases.updateTransaction(
+ "", // transactionId
+ false, // commit (optional)
+ false, // rollback (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/databases/upsert-document.md b/docs/examples/java/databases/upsert-document.md
index 868576b..52be46e 100644
--- a/docs/examples/java/databases/upsert-document.md
+++ b/docs/examples/java/databases/upsert-document.md
@@ -14,6 +14,7 @@ databases.upsertDocument(
"", // documentId
mapOf( "a" to "b" ), // data
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/create-operations.md b/docs/examples/java/tablesdb/create-operations.md
new file mode 100644
index 0000000..7ca288c
--- /dev/null
+++ b/docs/examples/java/tablesdb/create-operations.md
@@ -0,0 +1,33 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.createOperations(
+ "", // transactionId
+ listOf(
+ {
+ "action": "create",
+ "databaseId": "",
+ "tableId": "",
+ "rowId": "",
+ "data": {
+ "name": "Walter O'Brien"
+ }
+ }
+ ), // operations (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/create-row.md b/docs/examples/java/tablesdb/create-row.md
index 8273573..92a9058 100644
--- a/docs/examples/java/tablesdb/create-row.md
+++ b/docs/examples/java/tablesdb/create-row.md
@@ -20,6 +20,7 @@ tablesDB.createRow(
"isAdmin" to false
), // data
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/create-transaction.md b/docs/examples/java/tablesdb/create-transaction.md
new file mode 100644
index 0000000..c232c56
--- /dev/null
+++ b/docs/examples/java/tablesdb/create-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.createTransaction(
+ 60, // ttl (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/decrement-row-column.md b/docs/examples/java/tablesdb/decrement-row-column.md
index 73f2128..2252564 100644
--- a/docs/examples/java/tablesdb/decrement-row-column.md
+++ b/docs/examples/java/tablesdb/decrement-row-column.md
@@ -15,6 +15,7 @@ tablesDB.decrementRowColumn(
"", // column
0, // value (optional)
0, // min (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/delete-row.md b/docs/examples/java/tablesdb/delete-row.md
index d4c351b..6680100 100644
--- a/docs/examples/java/tablesdb/delete-row.md
+++ b/docs/examples/java/tablesdb/delete-row.md
@@ -12,6 +12,7 @@ tablesDB.deleteRow(
"", // databaseId
"", // tableId
"", // rowId
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/delete-transaction.md b/docs/examples/java/tablesdb/delete-transaction.md
new file mode 100644
index 0000000..18cb235
--- /dev/null
+++ b/docs/examples/java/tablesdb/delete-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.deleteTransaction(
+ "", // transactionId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/get-row.md b/docs/examples/java/tablesdb/get-row.md
index 191fc89..45efc6b 100644
--- a/docs/examples/java/tablesdb/get-row.md
+++ b/docs/examples/java/tablesdb/get-row.md
@@ -13,6 +13,7 @@ tablesDB.getRow(
"", // tableId
"", // rowId
listOf(), // queries (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/get-transaction.md b/docs/examples/java/tablesdb/get-transaction.md
new file mode 100644
index 0000000..fb51916
--- /dev/null
+++ b/docs/examples/java/tablesdb/get-transaction.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.getTransaction(
+ "", // transactionId
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/increment-row-column.md b/docs/examples/java/tablesdb/increment-row-column.md
index dc2120e..a1194a6 100644
--- a/docs/examples/java/tablesdb/increment-row-column.md
+++ b/docs/examples/java/tablesdb/increment-row-column.md
@@ -15,6 +15,7 @@ tablesDB.incrementRowColumn(
"", // column
0, // value (optional)
0, // max (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/list-rows.md b/docs/examples/java/tablesdb/list-rows.md
index dc50574..21f0005 100644
--- a/docs/examples/java/tablesdb/list-rows.md
+++ b/docs/examples/java/tablesdb/list-rows.md
@@ -12,6 +12,7 @@ tablesDB.listRows(
"", // databaseId
"", // tableId
listOf(), // queries (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/list-transactions.md b/docs/examples/java/tablesdb/list-transactions.md
new file mode 100644
index 0000000..c37ccf1
--- /dev/null
+++ b/docs/examples/java/tablesdb/list-transactions.md
@@ -0,0 +1,22 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.listTransactions(
+ listOf(), // queries (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/update-row.md b/docs/examples/java/tablesdb/update-row.md
index 0f1fabc..cea7baa 100644
--- a/docs/examples/java/tablesdb/update-row.md
+++ b/docs/examples/java/tablesdb/update-row.md
@@ -14,6 +14,7 @@ tablesDB.updateRow(
"", // rowId
mapOf( "a" to "b" ), // data (optional)
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/java/tablesdb/update-transaction.md b/docs/examples/java/tablesdb/update-transaction.md
new file mode 100644
index 0000000..804b5d5
--- /dev/null
+++ b/docs/examples/java/tablesdb/update-transaction.md
@@ -0,0 +1,24 @@
+import io.appwrite.Client;
+import io.appwrite.coroutines.CoroutineCallback;
+import io.appwrite.services.TablesDB;
+
+Client client = new Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject(""); // Your project ID
+
+TablesDB tablesDB = new TablesDB(client);
+
+tablesDB.updateTransaction(
+ "", // transactionId
+ false, // commit (optional)
+ false, // rollback (optional)
+ new CoroutineCallback<>((result, error) -> {
+ if (error != null) {
+ error.printStackTrace();
+ return;
+ }
+
+ Log.d("Appwrite", result.toString());
+ })
+);
+
diff --git a/docs/examples/java/tablesdb/upsert-row.md b/docs/examples/java/tablesdb/upsert-row.md
index 22c0e94..9d6323f 100644
--- a/docs/examples/java/tablesdb/upsert-row.md
+++ b/docs/examples/java/tablesdb/upsert-row.md
@@ -14,6 +14,7 @@ tablesDB.upsertRow(
"", // rowId
mapOf( "a" to "b" ), // data (optional)
listOf("read("any")"), // permissions (optional)
+ "", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
diff --git a/docs/examples/kotlin/databases/create-document.md b/docs/examples/kotlin/databases/create-document.md
index 7f0aaf8..7d4b04d 100644
--- a/docs/examples/kotlin/databases/create-document.md
+++ b/docs/examples/kotlin/databases/create-document.md
@@ -20,4 +20,5 @@ val result = databases.createDocument(
"isAdmin" to false
),
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/create-operations.md b/docs/examples/kotlin/databases/create-operations.md
new file mode 100644
index 0000000..62c9335
--- /dev/null
+++ b/docs/examples/kotlin/databases/create-operations.md
@@ -0,0 +1,24 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.createOperations(
+ transactionId = "",
+ operations = listOf(
+ {
+ "action": "create",
+ "databaseId": "",
+ "collectionId": "",
+ "documentId": "",
+ "data": {
+ "name": "Walter O'Brien"
+ }
+ }
+ ), // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/create-transaction.md b/docs/examples/kotlin/databases/create-transaction.md
new file mode 100644
index 0000000..3b953c3
--- /dev/null
+++ b/docs/examples/kotlin/databases/create-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.createTransaction(
+ ttl = 60, // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/decrement-document-attribute.md b/docs/examples/kotlin/databases/decrement-document-attribute.md
index c500fa8..84a4a0e 100644
--- a/docs/examples/kotlin/databases/decrement-document-attribute.md
+++ b/docs/examples/kotlin/databases/decrement-document-attribute.md
@@ -15,4 +15,5 @@ val result = databases.decrementDocumentAttribute(
attribute = "",
value = 0, // (optional)
min = 0, // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/delete-document.md b/docs/examples/kotlin/databases/delete-document.md
index 052bf97..242655e 100644
--- a/docs/examples/kotlin/databases/delete-document.md
+++ b/docs/examples/kotlin/databases/delete-document.md
@@ -12,4 +12,5 @@ val result = databases.deleteDocument(
databaseId = "",
collectionId = "",
documentId = "",
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/delete-transaction.md b/docs/examples/kotlin/databases/delete-transaction.md
new file mode 100644
index 0000000..bbce98c
--- /dev/null
+++ b/docs/examples/kotlin/databases/delete-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.deleteTransaction(
+ transactionId = "",
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/get-document.md b/docs/examples/kotlin/databases/get-document.md
index 157af2b..f21b6f3 100644
--- a/docs/examples/kotlin/databases/get-document.md
+++ b/docs/examples/kotlin/databases/get-document.md
@@ -13,4 +13,5 @@ val result = databases.getDocument(
collectionId = "",
documentId = "",
queries = listOf(), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/get-transaction.md b/docs/examples/kotlin/databases/get-transaction.md
new file mode 100644
index 0000000..0a1fda6
--- /dev/null
+++ b/docs/examples/kotlin/databases/get-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.getTransaction(
+ transactionId = "",
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/increment-document-attribute.md b/docs/examples/kotlin/databases/increment-document-attribute.md
index 0ae6b02..ca32cfc 100644
--- a/docs/examples/kotlin/databases/increment-document-attribute.md
+++ b/docs/examples/kotlin/databases/increment-document-attribute.md
@@ -15,4 +15,5 @@ val result = databases.incrementDocumentAttribute(
attribute = "",
value = 0, // (optional)
max = 0, // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/list-documents.md b/docs/examples/kotlin/databases/list-documents.md
index 1cc785f..a2b6e0e 100644
--- a/docs/examples/kotlin/databases/list-documents.md
+++ b/docs/examples/kotlin/databases/list-documents.md
@@ -12,4 +12,5 @@ val result = databases.listDocuments(
databaseId = "",
collectionId = "",
queries = listOf(), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/list-transactions.md b/docs/examples/kotlin/databases/list-transactions.md
new file mode 100644
index 0000000..da5cd4b
--- /dev/null
+++ b/docs/examples/kotlin/databases/list-transactions.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.listTransactions(
+ queries = listOf(), // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/update-document.md b/docs/examples/kotlin/databases/update-document.md
index d61fdea..2cacce6 100644
--- a/docs/examples/kotlin/databases/update-document.md
+++ b/docs/examples/kotlin/databases/update-document.md
@@ -14,4 +14,5 @@ val result = databases.updateDocument(
documentId = "",
data = mapOf( "a" to "b" ), // (optional)
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/update-transaction.md b/docs/examples/kotlin/databases/update-transaction.md
new file mode 100644
index 0000000..c9d6a85
--- /dev/null
+++ b/docs/examples/kotlin/databases/update-transaction.md
@@ -0,0 +1,15 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.Databases
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val databases = Databases(client)
+
+val result = databases.updateTransaction(
+ transactionId = "",
+ commit = false, // (optional)
+ rollback = false, // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/databases/upsert-document.md b/docs/examples/kotlin/databases/upsert-document.md
index a31dfc8..e5ac437 100644
--- a/docs/examples/kotlin/databases/upsert-document.md
+++ b/docs/examples/kotlin/databases/upsert-document.md
@@ -14,4 +14,5 @@ val result = databases.upsertDocument(
documentId = "",
data = mapOf( "a" to "b" ),
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/create-operations.md b/docs/examples/kotlin/tablesdb/create-operations.md
new file mode 100644
index 0000000..3073a00
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/create-operations.md
@@ -0,0 +1,24 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.createOperations(
+ transactionId = "",
+ operations = listOf(
+ {
+ "action": "create",
+ "databaseId": "",
+ "tableId": "",
+ "rowId": "",
+ "data": {
+ "name": "Walter O'Brien"
+ }
+ }
+ ), // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/create-row.md b/docs/examples/kotlin/tablesdb/create-row.md
index eb44cc4..f5850b2 100644
--- a/docs/examples/kotlin/tablesdb/create-row.md
+++ b/docs/examples/kotlin/tablesdb/create-row.md
@@ -20,4 +20,5 @@ val result = tablesDB.createRow(
"isAdmin" to false
),
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/create-transaction.md b/docs/examples/kotlin/tablesdb/create-transaction.md
new file mode 100644
index 0000000..b011fa0
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/create-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.createTransaction(
+ ttl = 60, // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/decrement-row-column.md b/docs/examples/kotlin/tablesdb/decrement-row-column.md
index 645e9f4..1a89640 100644
--- a/docs/examples/kotlin/tablesdb/decrement-row-column.md
+++ b/docs/examples/kotlin/tablesdb/decrement-row-column.md
@@ -15,4 +15,5 @@ val result = tablesDB.decrementRowColumn(
column = "",
value = 0, // (optional)
min = 0, // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/delete-row.md b/docs/examples/kotlin/tablesdb/delete-row.md
index 3fcd409..6912afa 100644
--- a/docs/examples/kotlin/tablesdb/delete-row.md
+++ b/docs/examples/kotlin/tablesdb/delete-row.md
@@ -12,4 +12,5 @@ val result = tablesDB.deleteRow(
databaseId = "",
tableId = "",
rowId = "",
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/delete-transaction.md b/docs/examples/kotlin/tablesdb/delete-transaction.md
new file mode 100644
index 0000000..92c0074
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/delete-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.deleteTransaction(
+ transactionId = "",
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/get-row.md b/docs/examples/kotlin/tablesdb/get-row.md
index b754cba..adea429 100644
--- a/docs/examples/kotlin/tablesdb/get-row.md
+++ b/docs/examples/kotlin/tablesdb/get-row.md
@@ -13,4 +13,5 @@ val result = tablesDB.getRow(
tableId = "",
rowId = "",
queries = listOf(), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/get-transaction.md b/docs/examples/kotlin/tablesdb/get-transaction.md
new file mode 100644
index 0000000..38b7c33
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/get-transaction.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.getTransaction(
+ transactionId = "",
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/increment-row-column.md b/docs/examples/kotlin/tablesdb/increment-row-column.md
index 230408a..1b679e1 100644
--- a/docs/examples/kotlin/tablesdb/increment-row-column.md
+++ b/docs/examples/kotlin/tablesdb/increment-row-column.md
@@ -15,4 +15,5 @@ val result = tablesDB.incrementRowColumn(
column = "",
value = 0, // (optional)
max = 0, // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/list-rows.md b/docs/examples/kotlin/tablesdb/list-rows.md
index 05d9ca3..6d2a4b8 100644
--- a/docs/examples/kotlin/tablesdb/list-rows.md
+++ b/docs/examples/kotlin/tablesdb/list-rows.md
@@ -12,4 +12,5 @@ val result = tablesDB.listRows(
databaseId = "",
tableId = "",
queries = listOf(), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/list-transactions.md b/docs/examples/kotlin/tablesdb/list-transactions.md
new file mode 100644
index 0000000..b7764c7
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/list-transactions.md
@@ -0,0 +1,13 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.listTransactions(
+ queries = listOf(), // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/update-row.md b/docs/examples/kotlin/tablesdb/update-row.md
index f99f8f2..a17f231 100644
--- a/docs/examples/kotlin/tablesdb/update-row.md
+++ b/docs/examples/kotlin/tablesdb/update-row.md
@@ -14,4 +14,5 @@ val result = tablesDB.updateRow(
rowId = "",
data = mapOf( "a" to "b" ), // (optional)
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/update-transaction.md b/docs/examples/kotlin/tablesdb/update-transaction.md
new file mode 100644
index 0000000..791649f
--- /dev/null
+++ b/docs/examples/kotlin/tablesdb/update-transaction.md
@@ -0,0 +1,15 @@
+import io.appwrite.Client
+import io.appwrite.coroutines.CoroutineCallback
+import io.appwrite.services.TablesDB
+
+val client = Client(context)
+ .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint
+ .setProject("") // Your project ID
+
+val tablesDB = TablesDB(client)
+
+val result = tablesDB.updateTransaction(
+ transactionId = "",
+ commit = false, // (optional)
+ rollback = false, // (optional)
+)
\ No newline at end of file
diff --git a/docs/examples/kotlin/tablesdb/upsert-row.md b/docs/examples/kotlin/tablesdb/upsert-row.md
index d82406a..074fa33 100644
--- a/docs/examples/kotlin/tablesdb/upsert-row.md
+++ b/docs/examples/kotlin/tablesdb/upsert-row.md
@@ -14,4 +14,5 @@ val result = tablesDB.upsertRow(
rowId = "",
data = mapOf( "a" to "b" ), // (optional)
permissions = listOf("read("any")"), // (optional)
+ transactionId = "", // (optional)
)
\ No newline at end of file
diff --git a/library/src/main/java/io/appwrite/Client.kt b/library/src/main/java/io/appwrite/Client.kt
index c046dff..e8f73f8 100644
--- a/library/src/main/java/io/appwrite/Client.kt
+++ b/library/src/main/java/io/appwrite/Client.kt
@@ -87,7 +87,7 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
- "x-sdk-version" to "11.1.0",
+ "x-sdk-version" to "11.2.0",
"x-appwrite-response-format" to "1.8.0"
)
config = mutableMapOf()
diff --git a/library/src/main/java/io/appwrite/models/Transaction.kt b/library/src/main/java/io/appwrite/models/Transaction.kt
new file mode 100644
index 0000000..baf32d3
--- /dev/null
+++ b/library/src/main/java/io/appwrite/models/Transaction.kt
@@ -0,0 +1,70 @@
+package io.appwrite.models
+
+import com.google.gson.annotations.SerializedName
+import io.appwrite.extensions.jsonCast
+
+/**
+ * Transaction
+ */
+data class Transaction(
+ /**
+ * Transaction ID.
+ */
+ @SerializedName("\$id")
+ val id: String,
+
+ /**
+ * Transaction creation time in ISO 8601 format.
+ */
+ @SerializedName("\$createdAt")
+ val createdAt: String,
+
+ /**
+ * Transaction update date in ISO 8601 format.
+ */
+ @SerializedName("\$updatedAt")
+ val updatedAt: String,
+
+ /**
+ * Current status of the transaction. One of: pending, committing, committed, rolled_back, failed.
+ */
+ @SerializedName("status")
+ val status: String,
+
+ /**
+ * Number of operations in the transaction.
+ */
+ @SerializedName("operations")
+ val operations: Long,
+
+ /**
+ * Expiration time in ISO 8601 format.
+ */
+ @SerializedName("expiresAt")
+ val expiresAt: String,
+
+) {
+ fun toMap(): Map = mapOf(
+ "\$id" to id as Any,
+ "\$createdAt" to createdAt as Any,
+ "\$updatedAt" to updatedAt as Any,
+ "status" to status as Any,
+ "operations" to operations as Any,
+ "expiresAt" to expiresAt as Any,
+ )
+
+ companion object {
+
+ @Suppress("UNCHECKED_CAST")
+ fun from(
+ map: Map,
+ ) = Transaction(
+ id = map["\$id"] as String,
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
+ status = map["status"] as String,
+ operations = (map["operations"] as Number).toLong(),
+ expiresAt = map["expiresAt"] as String,
+ )
+ }
+}
\ No newline at end of file
diff --git a/library/src/main/java/io/appwrite/models/TransactionList.kt b/library/src/main/java/io/appwrite/models/TransactionList.kt
new file mode 100644
index 0000000..1233ed4
--- /dev/null
+++ b/library/src/main/java/io/appwrite/models/TransactionList.kt
@@ -0,0 +1,38 @@
+package io.appwrite.models
+
+import com.google.gson.annotations.SerializedName
+import io.appwrite.extensions.jsonCast
+
+/**
+ * Transaction List
+ */
+data class TransactionList(
+ /**
+ * Total number of transactions that matched your query.
+ */
+ @SerializedName("total")
+ val total: Long,
+
+ /**
+ * List of transactions.
+ */
+ @SerializedName("transactions")
+ val transactions: List,
+
+) {
+ fun toMap(): Map = mapOf(
+ "total" to total as Any,
+ "transactions" to transactions.map { it.toMap() } as Any,
+ )
+
+ companion object {
+
+ @Suppress("UNCHECKED_CAST")
+ fun from(
+ map: Map,
+ ) = TransactionList(
+ total = (map["total"] as Number).toLong(),
+ transactions = (map["transactions"] as List