Skip to content

Commit ca1e48d

Browse files
authored
Merge pull request #46 from appwrite/dev
feat: Ruby SDK update for version 19.2.0
2 parents c3f4af1 + c69ba80 commit ca1e48d

Some content is hidden

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

46 files changed

+747
-53
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+
## 19.2.0
4+
5+
* Add transaction support for Databases and TablesDB
6+
37
## 19.1.0
48

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

appwrite.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |spec|
22

33
spec.name = 'appwrite'
4-
spec.version = '19.1.0'
4+
spec.version = '19.2.0'
55
spec.license = 'BSD-3-Clause'
66
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API'
77
spec.author = 'Appwrite Team'

docs/examples/databases/create-document.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ result = databases.create_document(
2020
"age" => 30,
2121
"isAdmin" => false
2222
},
23-
permissions: ["read("any")"] # optional
23+
permissions: ["read("any")"], # optional
24+
transaction_id: '<TRANSACTION_ID>' # optional
2425
)

docs/examples/databases/create-documents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ databases = Databases.new(client)
1212
result = databases.create_documents(
1313
database_id: '<DATABASE_ID>',
1414
collection_id: '<COLLECTION_ID>',
15-
documents: []
15+
documents: [],
16+
transaction_id: '<TRANSACTION_ID>' # optional
1617
)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
require 'appwrite'
2+
3+
include Appwrite
4+
5+
client = Client.new
6+
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
7+
.set_project('<YOUR_PROJECT_ID>') # Your project ID
8+
.set_key('<YOUR_API_KEY>') # Your secret API key
9+
10+
databases = Databases.new(client)
11+
12+
result = databases.create_operations(
13+
transaction_id: '<TRANSACTION_ID>',
14+
operations: [
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+
] # optional
25+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require 'appwrite'
2+
3+
include Appwrite
4+
5+
client = Client.new
6+
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
7+
.set_project('<YOUR_PROJECT_ID>') # Your project ID
8+
.set_key('<YOUR_API_KEY>') # Your secret API key
9+
10+
databases = Databases.new(client)
11+
12+
result = databases.create_transaction(
13+
ttl: 60 # optional
14+
)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ result = databases.decrement_document_attribute(
1515
document_id: '<DOCUMENT_ID>',
1616
attribute: '',
1717
value: null, # optional
18-
min: null # optional
18+
min: null, # optional
19+
transaction_id: '<TRANSACTION_ID>' # optional
1920
)

docs/examples/databases/delete-document.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ databases = Databases.new(client)
1212
result = databases.delete_document(
1313
database_id: '<DATABASE_ID>',
1414
collection_id: '<COLLECTION_ID>',
15-
document_id: '<DOCUMENT_ID>'
15+
document_id: '<DOCUMENT_ID>',
16+
transaction_id: '<TRANSACTION_ID>' # optional
1617
)

docs/examples/databases/delete-documents.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ databases = Databases.new(client)
1212
result = databases.delete_documents(
1313
database_id: '<DATABASE_ID>',
1414
collection_id: '<COLLECTION_ID>',
15-
queries: [] # optional
15+
queries: [], # optional
16+
transaction_id: '<TRANSACTION_ID>' # optional
1617
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require 'appwrite'
2+
3+
include Appwrite
4+
5+
client = Client.new
6+
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
7+
.set_project('<YOUR_PROJECT_ID>') # Your project ID
8+
.set_key('<YOUR_API_KEY>') # Your secret API key
9+
10+
databases = Databases.new(client)
11+
12+
result = databases.delete_transaction(
13+
transaction_id: '<TRANSACTION_ID>'
14+
)

0 commit comments

Comments
 (0)