Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 12.2.0

* Add transaction support for Databases and TablesDB

## 12.1.0

* Deprecate `createVerification` method in `Account` service
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:

```groovy
implementation("io.appwrite:sdk-for-kotlin:12.1.0")
implementation("io.appwrite:sdk-for-kotlin:12.2.0")
```

### Maven
Expand All @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-kotlin</artifactId>
<version>12.1.0</version>
<version>12.2.0</version>
</dependency>
</dependencies>
```
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ databases.createDocument(
"isAdmin" to false
), // data
listOf("read("any")"), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/create-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ databases.createDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // documents
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
34 changes: 34 additions & 0 deletions docs/examples/java/databases/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.createOperations(
"<TRANSACTION_ID>", // transactionId
listOf(
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"collectionId": "<COLLECTION_ID>",
"documentId": "<DOCUMENT_ID>",
"data": {
"name": "Walter O'Brien"
}
}
), // operations (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

23 changes: 23 additions & 0 deletions docs/examples/java/databases/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.createTransaction(
60, // ttl (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ databases.decrementDocumentAttribute(
"", // attribute
0, // value (optional)
0, // min (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/delete-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ databases.deleteDocument(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/delete-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ databases.deleteDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/java/databases/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.deleteTransaction(
"<TRANSACTION_ID>", // transactionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

1 change: 1 addition & 0 deletions docs/examples/java/databases/get-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ databases.getDocument(
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
listOf(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/java/databases/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.getTransaction(
"<TRANSACTION_ID>", // transactionId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ databases.incrementDocumentAttribute(
"", // attribute
0, // value (optional)
0, // max (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ databases.listDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/java/databases/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.listTransactions(
listOf(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

1 change: 1 addition & 0 deletions docs/examples/java/databases/update-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ databases.updateDocument(
"<DOCUMENT_ID>", // documentId
mapOf( "a" to "b" ), // data (optional)
listOf("read("any")"), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/update-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ databases.updateDocuments(
"<COLLECTION_ID>", // collectionId
mapOf( "a" to "b" ), // data (optional)
listOf(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
25 changes: 25 additions & 0 deletions docs/examples/java/databases/update-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

Databases databases = new Databases(client);

databases.updateTransaction(
"<TRANSACTION_ID>", // transactionId
false, // commit (optional)
false, // rollback (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

1 change: 1 addition & 0 deletions docs/examples/java/databases/upsert-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ databases.upsertDocument(
"<DOCUMENT_ID>", // documentId
mapOf( "a" to "b" ), // data
listOf("read("any")"), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/databases/upsert-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ databases.upsertDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // documents
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ messaging.createPush(
listOf(), // targets (optional)
mapOf( "a" to "b" ), // data (optional)
"<ACTION>", // action (optional)
"[ID1:ID2]", // image (optional)
"<ID1:ID2>", // image (optional)
"<ICON>", // icon (optional)
"<SOUND>", // sound (optional)
"<COLOR>", // color (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ messaging.updatePush(
"<BODY>", // body (optional)
mapOf( "a" to "b" ), // data (optional)
"<ACTION>", // action (optional)
"[ID1:ID2]", // image (optional)
"<ID1:ID2>", // image (optional)
"<ICON>", // icon (optional)
"<SOUND>", // sound (optional)
"<COLOR>", // color (optional)
Expand Down
34 changes: 34 additions & 0 deletions docs/examples/java/tablesdb/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDB;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

TablesDB tablesDB = new TablesDB(client);

tablesDB.createOperations(
"<TRANSACTION_ID>", // transactionId
listOf(
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"tableId": "<TABLE_ID>",
"rowId": "<ROW_ID>",
"data": {
"name": "Walter O'Brien"
}
}
), // operations (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

1 change: 1 addition & 0 deletions docs/examples/java/tablesdb/create-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tablesDB.createRow(
"isAdmin" to false
), // data
listOf("read("any")"), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/tablesdb/create-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tablesDB.createRows(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
listOf(), // rows
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/java/tablesdb/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.TablesDB;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setKey("<YOUR_API_KEY>"); // Your secret API key

TablesDB tablesDB = new TablesDB(client);

tablesDB.createTransaction(
60, // ttl (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

1 change: 1 addition & 0 deletions docs/examples/java/tablesdb/decrement-row-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tablesDB.decrementRowColumn(
"", // column
0, // value (optional)
0, // min (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/tablesdb/delete-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tablesDB.deleteRow(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
"<ROW_ID>", // rowId
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/tablesdb/delete-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tablesDB.deleteRows(
"<DATABASE_ID>", // databaseId
"<TABLE_ID>", // tableId
listOf(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
Loading