From 2e4561a4f601c173e8e2f6abbed189431dd3c09b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 17 Dec 2025 18:54:12 +1300 Subject: [PATCH 1/4] Add full schema collection create --- .../account/create-anonymous-session.md | 3 +- .../account/create-email-password-session.md | 3 +- docs/examples/account/create-email-token.md | 3 +- docs/examples/account/create-jwt.md | 3 +- .../account/create-magic-url-token.md | 3 +- docs/examples/account/create-mfa-challenge.md | 3 +- .../examples/account/create-o-auth-2-token.md | 3 +- docs/examples/account/create-phone-token.md | 3 +- docs/examples/account/create-session.md | 3 +- docs/examples/account/create.md | 3 +- .../account/update-magic-url-session.md | 3 +- docs/examples/account/update-phone-session.md | 3 +- docs/examples/databases/create-collection.md | 4 ++- docs/examples/tablesdb/create-table.md | 4 ++- src/services/databases.ts | 28 ++++++++++++++----- src/services/tables-db.ts | 28 ++++++++++++++----- 16 files changed, 72 insertions(+), 28 deletions(-) diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index d8590b0..0ec4807 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index f173d21..582ca29 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index eb071b9..6bb7254 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index 2273646..76d52e1 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index 59f7d10..d5194c5 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 4195f46..9588fa1 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index cc4f315..7f9e229 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index fe88e77..b5bb586 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 448f901..9e6f068 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index 7ba2d42..48ef1aa 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index d67d481..65221b5 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 7d96800..d2e7543 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -2,7 +2,8 @@ const sdk = require('node-appwrite'); const client = new sdk.Client() .setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - .setProject(''); // Your project ID + .setProject('') // Your project ID + .setSession(''); // The user session to authenticate with const account = new sdk.Account(client); diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 9bc014b..562b538 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -13,5 +13,7 @@ const result = await databases.createCollection({ name: '', permissions: [sdk.Permission.read(sdk.Role.any())], // optional documentSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + attributes: [], // optional + indexes: [] // optional }); diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index 6a4c12d..120f5de 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -13,5 +13,7 @@ const result = await tablesDB.createTable({ name: '', permissions: [sdk.Permission.read(sdk.Role.any())], // optional rowSecurity: false, // optional - enabled: false // optional + enabled: false, // optional + columns: [], // optional + indexes: [] // optional }); diff --git a/src/services/databases.ts b/src/services/databases.ts index 7852c55..d6b29b1 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -747,11 +747,13 @@ export class Databases { * @param {string[]} params.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 {boolean} params.documentSecurity - 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 {boolean} params.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 {object[]} params.attributes - Array of attribute definitions to create. Each attribute 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 {object[]} params.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). * @throws {AppwriteException} * @returns {Promise} * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createTable` instead. */ - createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }): Promise; + createCollection(params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }): Promise; /** * Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. * @@ -761,19 +763,21 @@ export class Databases { * @param {string[]} 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 {boolean} documentSecurity - 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 {boolean} 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 {object[]} attributes - Array of attribute definitions to create. Each attribute 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 {object[]} 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). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise; + createCollection(databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[]): Promise; createCollection( - paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (object[])?, (object[])?] ): Promise { - let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, collectionId: string, name: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean, attributes?: object[], indexes?: object[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -781,7 +785,9 @@ export class Databases { name: rest[1] as string, permissions: rest[2] as string[], documentSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + attributes: rest[5] as object[], + indexes: rest[6] as object[] }; } @@ -791,6 +797,8 @@ export class Databases { const permissions = params.permissions; const documentSecurity = params.documentSecurity; const enabled = params.enabled; + const attributes = params.attributes; + const indexes = params.indexes; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -819,6 +827,12 @@ export class Databases { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof attributes !== 'undefined') { + payload['attributes'] = attributes; + } + if (typeof indexes !== 'undefined') { + payload['indexes'] = indexes; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { diff --git a/src/services/tables-db.ts b/src/services/tables-db.ts index d60e495..846718c 100644 --- a/src/services/tables-db.ts +++ b/src/services/tables-db.ts @@ -741,10 +741,12 @@ export class TablesDB { * @param {string[]} params.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 {boolean} params.rowSecurity - 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 {boolean} params.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 {object[]} params.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 {object[]} params.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). * @throws {AppwriteException} * @returns {Promise} */ - createTable(params: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }): Promise; + createTable(params: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[] }): Promise; /** * Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. * @@ -754,19 +756,21 @@ export class TablesDB { * @param {string[]} 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 {boolean} rowSecurity - 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 {boolean} 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 {object[]} 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 {object[]} 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). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ - createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean): Promise; + createTable(databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[]): Promise; createTable( - paramsOrFirst: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean } | string, - ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?] + paramsOrFirst: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[] } | string, + ...rest: [(string)?, (string)?, (string[])?, (boolean)?, (boolean)?, (object[])?, (object[])?] ): Promise { - let params: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + let params: { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[] }; if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) { - params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean }; + params = (paramsOrFirst || {}) as { databaseId: string, tableId: string, name: string, permissions?: string[], rowSecurity?: boolean, enabled?: boolean, columns?: object[], indexes?: object[] }; } else { params = { databaseId: paramsOrFirst as string, @@ -774,7 +778,9 @@ export class TablesDB { name: rest[1] as string, permissions: rest[2] as string[], rowSecurity: rest[3] as boolean, - enabled: rest[4] as boolean + enabled: rest[4] as boolean, + columns: rest[5] as object[], + indexes: rest[6] as object[] }; } @@ -784,6 +790,8 @@ export class TablesDB { const permissions = params.permissions; const rowSecurity = params.rowSecurity; const enabled = params.enabled; + const columns = params.columns; + const indexes = params.indexes; if (typeof databaseId === 'undefined') { throw new AppwriteException('Missing required parameter: "databaseId"'); @@ -812,6 +820,12 @@ export class TablesDB { if (typeof enabled !== 'undefined') { payload['enabled'] = enabled; } + if (typeof columns !== 'undefined') { + payload['columns'] = columns; + } + if (typeof indexes !== 'undefined') { + payload['indexes'] = indexes; + } const uri = new URL(this.client.config.endpoint + apiPath); const apiHeaders: { [header: string]: string } = { From 704d46fc1aac1710b3a25a0a853a5814e6dca7de Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 17 Dec 2025 19:21:05 +1300 Subject: [PATCH 2/4] Update version --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/client.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2811a06..c1a4f6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## 21.1.0 + +* Added ability to create attributes and indexes synchronously while creating a collection + ## 21.0.0 * Rename `VCSDeploymentType` enum to `VCSReferenceType` diff --git a/package.json b/package.json index e8c6e4e..560a05f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "node-appwrite", "homepage": "https://appwrite.io/support", "description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API", - "version": "21.0.0", + "version": "21.1.0", "license": "BSD-3-Clause", "main": "dist/index.js", "type": "commonjs", diff --git a/src/client.ts b/src/client.ts index 8a2e397..564b24a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -33,7 +33,7 @@ class AppwriteException extends Error { } function getUserAgent() { - let ua = 'AppwriteNodeJSSDK/21.0.0'; + let ua = 'AppwriteNodeJSSDK/21.1.0'; // `process` is a global in Node.js, but not fully available in all runtimes. const platform: string[] = []; @@ -82,7 +82,7 @@ class Client { 'x-sdk-name': 'Node.js', 'x-sdk-platform': 'server', 'x-sdk-language': 'nodejs', - 'x-sdk-version': '21.0.0', + 'x-sdk-version': '21.1.0', 'user-agent' : getUserAgent(), 'X-Appwrite-Response-Format': '1.8.0', }; From 37ef23188e28f73ca27c69124adf7be0be4be4dd Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 18 Dec 2025 20:30:48 +1300 Subject: [PATCH 3/4] Remove invalid type --- src/services/databases.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/databases.ts b/src/services/databases.ts index d6b29b1..ad69b3e 100644 --- a/src/services/databases.ts +++ b/src/services/databases.ts @@ -747,7 +747,7 @@ export class Databases { * @param {string[]} params.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 {boolean} params.documentSecurity - 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 {boolean} params.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 {object[]} params.attributes - Array of attribute definitions to create. Each attribute 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 {object[]} params.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 {object[]} params.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). * @throws {AppwriteException} * @returns {Promise} @@ -763,7 +763,7 @@ export class Databases { * @param {string[]} 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 {boolean} documentSecurity - 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 {boolean} 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 {object[]} attributes - Array of attribute definitions to create. Each attribute 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 {object[]} 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 {object[]} 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). * @throws {AppwriteException} * @returns {Promise} From 1f96d643f8bf81575568575391a662418a3a5d90 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 18 Dec 2025 20:34:19 +1300 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1a4f6a..da425ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 21.1.0 -* Added ability to create attributes and indexes synchronously while creating a collection +* Added ability to create columns and indexes synchronously while creating a table ## 21.0.0