Skip to content

Commit d1ea40e

Browse files
authored
Merge pull request #276 from appwrite/dev
feat: Flutter SDK update for version 20.2.0
2 parents 439d798 + 93a5820 commit d1ea40e

Some content is hidden

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

42 files changed

+869
-14
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+
## 20.2.0
4+
5+
* Add transaction support for Databases and TablesDB
6+
37
## 20.1.0
48

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
2121

2222
```yml
2323
dependencies:
24-
appwrite: ^20.1.0
24+
appwrite: ^20.2.0
2525
```
2626
2727
You can install packages from the command line:

docs/examples/databases/create-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ Document result = await databases.createDocument(
1818
"isAdmin": false
1919
},
2020
permissions: ["read("any")"], // optional
21+
transactionId: '<TRANSACTION_ID>', // optional
2122
);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
Databases databases = Databases(client);
8+
9+
Transaction result = await databases.createOperations(
10+
transactionId: '<TRANSACTION_ID>',
11+
operations: [
12+
{
13+
"action": "create",
14+
"databaseId": "<DATABASE_ID>",
15+
"collectionId": "<COLLECTION_ID>",
16+
"documentId": "<DOCUMENT_ID>",
17+
"data": {
18+
"name": "Walter O'Brien"
19+
}
20+
}
21+
], // optional
22+
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
Databases databases = Databases(client);
8+
9+
Transaction result = await databases.createTransaction(
10+
ttl: 60, // optional
11+
);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ Document result = await databases.decrementDocumentAttribute(
1313
attribute: '',
1414
value: 0, // optional
1515
min: 0, // optional
16+
transactionId: '<TRANSACTION_ID>', // optional
1617
);

docs/examples/databases/delete-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ await databases.deleteDocument(
1010
databaseId: '<DATABASE_ID>',
1111
collectionId: '<COLLECTION_ID>',
1212
documentId: '<DOCUMENT_ID>',
13+
transactionId: '<TRANSACTION_ID>', // optional
1314
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
Databases databases = Databases(client);
8+
9+
await databases.deleteTransaction(
10+
transactionId: '<TRANSACTION_ID>',
11+
);

docs/examples/databases/get-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ Document result = await databases.getDocument(
1111
collectionId: '<COLLECTION_ID>',
1212
documentId: '<DOCUMENT_ID>',
1313
queries: [], // optional
14+
transactionId: '<TRANSACTION_ID>', // optional
1415
);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
Client client = Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
Databases databases = Databases(client);
8+
9+
Transaction result = await databases.getTransaction(
10+
transactionId: '<TRANSACTION_ID>',
11+
);

0 commit comments

Comments
 (0)