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

## 19.2.0

* Add transaction support for Databases and TablesDB

## 19.1.0

* Deprecate `createVerification` method in `Account` service
Expand Down
2 changes: 1 addition & 1 deletion appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '19.1.0'
spec.version = '19.2.0'
spec.license = 'BSD-3-Clause'
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'
spec.author = 'Appwrite Team'
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/databases/create-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ result = databases.create_document(
"age" => 30,
"isAdmin" => false
},
permissions: ["read("any")"] # optional
permissions: ["read("any")"], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/create-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ databases = Databases.new(client)
result = databases.create_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
documents: []
documents: [],
transaction_id: '<TRANSACTION_ID>' # optional
)
25 changes: 25 additions & 0 deletions docs/examples/databases/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_operations(
transaction_id: '<TRANSACTION_ID>',
operations: [
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"collectionId": "<COLLECTION_ID>",
"documentId": "<DOCUMENT_ID>",
"data": {
"name": "Walter O'Brien"
}
}
] # optional
)
14 changes: 14 additions & 0 deletions docs/examples/databases/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.create_transaction(
ttl: 60 # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ result = databases.decrement_document_attribute(
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
min: null # optional
min: null, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/delete-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ databases = Databases.new(client)
result = databases.delete_document(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>'
document_id: '<DOCUMENT_ID>',
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/delete-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ databases = Databases.new(client)
result = databases.delete_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/databases/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.delete_transaction(
transaction_id: '<TRANSACTION_ID>'
)
3 changes: 2 additions & 1 deletion docs/examples/databases/get-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ result = databases.get_document(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/databases/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.get_transaction(
transaction_id: '<TRANSACTION_ID>'
)
3 changes: 2 additions & 1 deletion docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ result = databases.increment_document_attribute(
document_id: '<DOCUMENT_ID>',
attribute: '',
value: null, # optional
max: null # optional
max: null, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ databases = Databases.new(client)
result = databases.list_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/databases/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.list_transactions(
queries: [] # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/update-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ result = databases.update_document(
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
data: {}, # optional
permissions: ["read("any")"] # optional
permissions: ["read("any")"], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/update-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ result = databases.update_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
data: {}, # optional
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
16 changes: 16 additions & 0 deletions docs/examples/databases/update-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

databases = Databases.new(client)

result = databases.update_transaction(
transaction_id: '<TRANSACTION_ID>',
commit: false, # optional
rollback: false # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/upsert-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ result = databases.upsert_document(
collection_id: '<COLLECTION_ID>',
document_id: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"] # optional
permissions: ["read("any")"], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/databases/upsert-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ databases = Databases.new(client)
result = databases.upsert_documents(
database_id: '<DATABASE_ID>',
collection_id: '<COLLECTION_ID>',
documents: []
documents: [],
transaction_id: '<TRANSACTION_ID>' # optional
)
2 changes: 1 addition & 1 deletion docs/examples/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ result = messaging.create_push(
targets: [], # optional
data: {}, # optional
action: '<ACTION>', # optional
image: '[ID1:ID2]', # optional
image: '<ID1:ID2>', # optional
icon: '<ICON>', # optional
sound: '<SOUND>', # optional
color: '<COLOR>', # optional
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ result = messaging.update_push(
body: '<BODY>', # optional
data: {}, # optional
action: '<ACTION>', # optional
image: '[ID1:ID2]', # optional
image: '<ID1:ID2>', # optional
icon: '<ICON>', # optional
sound: '<SOUND>', # optional
color: '<COLOR>', # optional
Expand Down
25 changes: 25 additions & 0 deletions docs/examples/tablesdb/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.create_operations(
transaction_id: '<TRANSACTION_ID>',
operations: [
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"tableId": "<TABLE_ID>",
"rowId": "<ROW_ID>",
"data": {
"name": "Walter O'Brien"
}
}
] # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ result = tables_db.create_row(
"age" => 30,
"isAdmin" => false
},
permissions: ["read("any")"] # optional
permissions: ["read("any")"], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/create-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client)
result = tables_db.create_rows(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
rows: []
rows: [],
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.create_transaction(
ttl: 60 # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/decrement-row-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ result = tables_db.decrement_row_column(
row_id: '<ROW_ID>',
column: '',
value: null, # optional
min: null # optional
min: null, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/delete-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client)
result = tables_db.delete_row(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
row_id: '<ROW_ID>'
row_id: '<ROW_ID>',
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/delete-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client)
result = tables_db.delete_rows(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.delete_transaction(
transaction_id: '<TRANSACTION_ID>'
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/get-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ result = tables_db.get_row(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
row_id: '<ROW_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.get_transaction(
transaction_id: '<TRANSACTION_ID>'
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/increment-row-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ result = tables_db.increment_row_column(
row_id: '<ROW_ID>',
column: '',
value: null, # optional
max: null # optional
max: null, # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/list-rows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client)
result = tables_db.list_rows(
database_id: '<DATABASE_ID>',
table_id: '<TABLE_ID>',
queries: [] # optional
queries: [], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_key('<YOUR_API_KEY>') # Your secret API key

tables_db = TablesDB.new(client)

result = tables_db.list_transactions(
queries: [] # optional
)
3 changes: 2 additions & 1 deletion docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ result = tables_db.update_row(
table_id: '<TABLE_ID>',
row_id: '<ROW_ID>',
data: {}, # optional
permissions: ["read("any")"] # optional
permissions: ["read("any")"], # optional
transaction_id: '<TRANSACTION_ID>' # optional
)
Loading