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

## 20.1.0

* Added ability to create columns and indexes synchronously while creating a table

## 20.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
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 = '20.0.0'
spec.version = '20.1.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
1 change: 1 addition & 0 deletions docs/examples/account/create-anonymous-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-email-password-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-email-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-jwt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-magic-url-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include Appwrite::Enums
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include Appwrite::Enums
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
.set_project('<YOUR_PROJECT_ID>') # Your project ID
.set_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-phone-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/update-magic-url-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
1 change: 1 addition & 0 deletions docs/examples/account/update-phone-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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_session('') # The user session to authenticate with

account = Account.new(client)

Expand Down
4 changes: 3 additions & 1 deletion docs/examples/databases/create-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ result = databases.create_collection(
name: '<NAME>',
permissions: [Permission.read(Role.any())], # optional
document_security: false, # optional
enabled: false # optional
enabled: false, # optional
attributes: [], # optional
indexes: [] # optional
)
4 changes: 3 additions & 1 deletion docs/examples/tablesdb/create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ result = tables_db.create_table(
name: '<NAME>',
permissions: [Permission.read(Role.any())], # optional
row_security: false, # optional
enabled: false # optional
enabled: false, # optional
columns: [], # optional
indexes: [] # optional
)
2 changes: 1 addition & 1 deletion lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize
'x-sdk-name'=> 'Ruby',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'ruby',
'x-sdk-version'=> '20.0.0',
'x-sdk-version'=> '20.1.0',
'X-Appwrite-Response-Format' => '1.8.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
Expand Down
6 changes: 5 additions & 1 deletion lib/appwrite/services/databases.rb
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,11 @@ def list_collections(database_id:, queries: nil, search: nil, total: nil)
# @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
# @param [] document_security Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
# @param [] enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
# @param [Array] attributes Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
# @param [Array] indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
#
# @return [Collection]
def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil)
def create_collection(database_id:, collection_id:, name:, permissions: nil, document_security: nil, enabled: nil, attributes: nil, indexes: nil)
api_path = '/databases/{databaseId}/collections'
.gsub('{databaseId}', database_id)

Expand All @@ -429,6 +431,8 @@ def create_collection(database_id:, collection_id:, name:, permissions: nil, doc
permissions: permissions,
documentSecurity: document_security,
enabled: enabled,
attributes: attributes,
indexes: indexes,
}

api_headers = {
Expand Down
6 changes: 5 additions & 1 deletion lib/appwrite/services/tables_db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,11 @@ def list_tables(database_id:, queries: nil, search: nil, total: nil)
# @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
# @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
# @param [] enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
# @param [Array] columns Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
# @param [Array] indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
#
# @return [Table]
def create_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil)
def create_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil, columns: nil, indexes: nil)
api_path = '/tablesdb/{databaseId}/tables'
.gsub('{databaseId}', database_id)

Expand All @@ -408,6 +410,8 @@ def create_table(database_id:, table_id:, name:, permissions: nil, row_security:
permissions: permissions,
rowSecurity: row_security,
enabled: enabled,
columns: columns,
indexes: indexes,
}

api_headers = {
Expand Down