Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8419270

Browse filesBrowse files
committed
Add transactions
1 parent 736b109 commit 8419270
Copy full SHA for 8419270

File tree

Expand file treeCollapse file tree

83 files changed

+1223
-33
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

83 files changed

+1223
-33
lines changed
Open diff view settings
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
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
```
Collapse file

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

Copy file name to clipboardExpand all lines: docs/examples/java/databases/create-document.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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();
Collapse file

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

Copy file name to clipboardExpand all lines: docs/examples/java/databases/create-documents.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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();
Collapse file
+34Lines changed: 34 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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+
Collapse file
+23Lines changed: 23 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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+
Collapse file

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

Copy file name to clipboardExpand all lines: docs/examples/java/databases/decrement-document-attribute.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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();
Collapse file

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

Copy file name to clipboardExpand all lines: docs/examples/java/databases/delete-document.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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();
Collapse file

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

Copy file name to clipboardExpand all lines: docs/examples/java/databases/delete-documents.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
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();
Collapse file
+23Lines changed: 23 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.