The TablesDB service allows you to create structured tables of rows, query and filter lists of rows, and manage an advanced set of read and write access permissions.
All data returned by the TablesDB service are represented as structured JSON rows.
The TablesDB service can contain multiple databases, each database can contain multiple tables. A table is a group of similarly structured rows. The accepted structure of rows is defined by table columns. The table columns help you ensure all your user-submitted data is validated and stored according to the table structure.
Using Appwrite permissions architecture, you can assign read or write access to each table or row in your project for
either a specific user, team, user role, or even grant it with public access (any
). You can learn more
about how Appwrite handles permissions and access control.
https://<REGION>.cloud.appwrite.io/v1
Create database
Create a new Database.
Request
databaseId string requiredUnique Id. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredDatabase name. Max length: 128 chars.
enabled boolean Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
Response
201 application/json
POST /tablesdb
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Database result = await tablesDB.create(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false, // (optional)
);
Get database
Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
Request
databaseId string requiredDatabase ID.
Response
200 application/json
GET /tablesdb/{databaseId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Database result = await tablesDB.get(
databaseId: '<DATABASE_ID>',
);
List databases
Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
Request
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /tablesdb
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
DatabaseList result = await tablesDB.list(
queries: [], // (optional)
search: '<SEARCH>', // (optional)
);
Update database
Update a database by its unique ID.
Request
databaseId string requiredDatabase ID.
name string requiredDatabase name. Max length: 128 chars.
enabled boolean Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
Response
200 application/json
PUT /tablesdb/{databaseId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Database result = await tablesDB.update(
databaseId: '<DATABASE_ID>',
name: '<NAME>',
enabled: false, // (optional)
);
Delete database
Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
Request
databaseId string requiredDatabase ID.
Response
204 no content
DELETE /tablesdb/{databaseId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.delete(
databaseId: '<DATABASE_ID>',
);
Create table
Create a new Table. Before using this route, you should create a new database resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
tableId string requiredUnique Id. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.name string requiredTable name. Max length: 128 chars.
permissions array An array of permissions strings. By default, no user is granted with any permissions. Learn more about permissions.
rowSecurity boolean Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. Learn more about permissions.
enabled boolean 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.
Response
201 application/json
POST /tablesdb/{databaseId}/tables
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Table result = await tablesDB.createTable(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
name: '<NAME>',
permissions: ["read("any")"], // (optional)
rowSecurity: false, // (optional)
enabled: false, // (optional)
);
Get table
Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Table result = await tablesDB.getTable(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
);
List tables
Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.
Request
databaseId string requiredDatabase ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity
search string Search term to filter your list results. Max length: 256 chars.
Response
200 application/json
GET /tablesdb/{databaseId}/tables
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
TableList result = await tablesDB.listTables(
databaseId: '<DATABASE_ID>',
queries: [], // (optional)
search: '<SEARCH>', // (optional)
);
Update table
Update a table by its unique ID.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
name string requiredTable name. Max length: 128 chars.
permissions array An array of permission strings. By default, the current permissions are inherited. Learn more about permissions.
rowSecurity boolean Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. Learn more about permissions.
enabled boolean 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.
Response
200 application/json
PUT /tablesdb/{databaseId}/tables/{tableId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Table result = await tablesDB.updateTable(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
name: '<NAME>',
permissions: ["read("any")"], // (optional)
rowSecurity: false, // (optional)
enabled: false, // (optional)
);
Delete table
Delete a table by its unique ID. Only users with write permissions have access to delete this resource.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
Response
204 no content
DELETE /tablesdb/{databaseId}/tables/{tableId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteTable(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
);
Create boolean column
Create a boolean column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default boolean Default value for column when not provided. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/boolean
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnBoolean result = await tablesDB.createBooleanColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: false, // (optional)
array: false, // (optional)
);
Create datetime column
Create a date time column according to the ISO 8601 standard.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string Default value for the column in ISO 8601 format. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/datetime
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnDatetime result = await tablesDB.createDatetimeColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
Create email column
Create an email column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string Default value for column when not provided. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/email
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnEmail result = await tablesDB.createEmailColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'email@example.com', // (optional)
array: false, // (optional)
);
Create enum column
Create an enumeration column. The elements
param acts as a white-list of accepted values for this column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
elements array requiredArray of enum values.
required boolean requiredIs column required?
default string Default value for column when not provided. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/enum
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnEnum result = await tablesDB.createEnumColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
elements: [],
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
);
Create float column
Create a float column. Optionally, minimum and maximum values can be provided.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
min number Minimum value
max number Maximum value
default number Default value. Cannot be set when required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/float
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnFloat result = await tablesDB.createFloatColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
Create integer column
Create an integer column. Optionally, minimum and maximum values can be provided.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
min integer Minimum value
max integer Maximum value
default integer Default value. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/integer
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnInteger result = await tablesDB.createIntegerColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
min: 0, // (optional)
max: 0, // (optional)
xdefault: 0, // (optional)
array: false, // (optional)
);
Create IP address column
Create IP address column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string Default value. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/ip
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnIp result = await tablesDB.createIpColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '', // (optional)
array: false, // (optional)
);
Create line column
Create a geometric line column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/line
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnLine result = await tablesDB.createLineColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
);
Create point column
Create a geometric point column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/point
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnPoint result = await tablesDB.createPointColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [1, 2], // (optional)
);
Create polygon column
Create a geometric polygon column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/polygon
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnPolygon result = await tablesDB.createPolygonColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
);
Create relationship column
Create relationship column. Learn more about relationship columns.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
relatedTableId string requiredRelated Table ID.
type string requiredRelation type
twoWay boolean Is Two Way?
key string Column Key.
twoWayKey string Two Way Column Key.
onDelete string Constraints option
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/relationship
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnRelationship result = await tablesDB.createRelationshipColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
relatedTableId: '<RELATED_TABLE_ID>',
type: RelationshipType.oneToOne,
twoWay: false, // (optional)
key: '', // (optional)
twoWayKey: '', // (optional)
onDelete: RelationMutate.cascade, // (optional)
);
Create string column
Create a string column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredColumn Key.
size integer requiredColumn size for text columns, in number of characters.
required boolean requiredIs column required?
default string Default value for column when not provided. Cannot be set when column is required.
array boolean Is column an array?
encrypt boolean Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/string
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnString result = await tablesDB.createStringColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
size: 1,
xrequired: false,
xdefault: '<DEFAULT>', // (optional)
array: false, // (optional)
encrypt: false, // (optional)
);
Create URL column
Create a URL column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string Default value for column when not provided. Cannot be set when column is required.
array boolean Is column an array?
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/columns/url
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnUrl result = await tablesDB.createUrlColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'https://example.com', // (optional)
array: false, // (optional)
);
Get column
Get column by ID.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
Response
GET /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
result = await tablesDB.getColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
List columns
List columns in the table.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}/columns
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnList result = await tablesDB.listColumns(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // (optional)
);
Update boolean column
Update a boolean column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default boolean requiredDefault value for column when not provided. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnBoolean result = await tablesDB.updateBooleanColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: false,
newKey: '', // (optional)
);
Update dateTime column
Update a date time column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string requiredDefault value for column when not provided. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnDatetime result = await tablesDB.updateDatetimeColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '',
newKey: '', // (optional)
);
Update email column
Update an email column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string requiredDefault value for column when not provided. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnEmail result = await tablesDB.updateEmailColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'email@example.com',
newKey: '', // (optional)
);
Update enum column
Update an enum column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
elements array requiredUpdated list of enum values.
required boolean requiredIs column required?
default string requiredDefault value for column when not provided. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnEnum result = await tablesDB.updateEnumColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
elements: [],
xrequired: false,
xdefault: '<DEFAULT>',
newKey: '', // (optional)
);
Update float column
Update a float column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default number requiredDefault value. Cannot be set when required.
min number Minimum value
max number Maximum value
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnFloat result = await tablesDB.updateFloatColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 0,
min: 0, // (optional)
max: 0, // (optional)
newKey: '', // (optional)
);
Update integer column
Update an integer column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default integer requiredDefault value. Cannot be set when column is required.
min integer Minimum value
max integer Maximum value
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnInteger result = await tablesDB.updateIntegerColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 0,
min: 0, // (optional)
max: 0, // (optional)
newKey: '', // (optional)
);
Update IP address column
Update an ip column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string requiredDefault value. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnIp result = await tablesDB.updateIpColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '',
newKey: '', // (optional)
);
Update line column
Update a line column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnLine result = await tablesDB.updateLineColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[1, 2], [3, 4], [5, 6]], // (optional)
newKey: '', // (optional)
);
Update point column
Update a point column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnPoint result = await tablesDB.updatePointColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [1, 2], // (optional)
newKey: '', // (optional)
);
Update polygon column
Update a polygon column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default array Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnPolygon result = await tablesDB.updatePolygonColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // (optional)
newKey: '', // (optional)
);
Update relationship column
Update relationship column. Learn more about relationship columns.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
onDelete string Constraints option
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnRelationship result = await tablesDB.updateRelationshipColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
onDelete: RelationMutate.cascade, // (optional)
newKey: '', // (optional)
);
Update string column
Update a string column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredColumn Key.
required boolean requiredIs column required?
default string requiredDefault value for column when not provided. Cannot be set when column is required.
size integer Maximum size of the string column.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnString result = await tablesDB.updateStringColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: '<DEFAULT>',
size: 1, // (optional)
newKey: '', // (optional)
);
Update URL column
Update an url column. Changing the default
value will not update already existing rows.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
required boolean requiredIs column required?
default string requiredDefault value for column when not provided. Cannot be set when column is required.
newKey string New Column Key.
Response
200 application/json
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnUrl result = await tablesDB.updateUrlColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
xrequired: false,
xdefault: 'https://example.com',
newKey: '', // (optional)
);
Delete column
Deletes a column.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
key string requiredColumn Key.
Response
204 no content
DELETE /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
Create index
Creates an index on the columns listed. Your index should include all the columns you will query in a single request.
Type can be key
, fulltext
, or unique
.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredIndex Key.
type string requiredIndex type.
columns array requiredArray of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
orders array Array of index orders. Maximum of 100 orders are allowed.
lengths array Length of index. Maximum of 100
Response
202 application/json
POST /tablesdb/{databaseId}/tables/{tableId}/indexes
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnIndex result = await tablesDB.createIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
type: IndexType.key,
columns: [],
orders: [], // (optional)
lengths: [], // (optional)
);
Get index
Get index by ID.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
key string requiredIndex Key.
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnIndex result = await tablesDB.getIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
List indexes
List indexes on the table.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}/indexes
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
ColumnIndexList result = await tablesDB.listIndexes(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // (optional)
);
Delete index
Delete an index.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
key string requiredIndex Key.
Response
204 no content
DELETE /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteIndex(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
);
Create row
Create a new Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration. Make sure to define columns before creating rows.
rowId string Row ID. Choose a custom ID or generate a random ID with
ID.unique()
. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.data object Row data as JSON object.
permissions array An array of permissions strings. By default, only the current user is granted all permissions. Learn more about permissions.
transactionId string Transaction ID for staging the operation.
Response
201 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
POST /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.createRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
},
permissions: ["read("any")"], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Create rows
Create new Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration. Make sure to define columns before creating rows.
rows array Array of rows data as JSON objects.
transactionId string Transaction ID for staging the operation.
Response
201 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
POST /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
RowList result = await tablesDB.createRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: [],
transactionId: '<TRANSACTION_ID>', // (optional)
);
Get row
Get a row by its unique ID. This endpoint response returns a JSON object with the row data.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
rowId string requiredRow ID.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string Transaction ID to read uncommitted changes within the transaction.
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.getRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
queries: [], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
List rows
Get a list of all the user's rows in a given table. You can use the query params to filter your results.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the TablesDB service server integration.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string Transaction ID to read uncommitted changes within the transaction.
Response
200 application/json
GET /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
RowList result = await tablesDB.listRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Update row
Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
rowId string requiredRow ID.
data object Row data as JSON object. Include only columns and value pairs to be updated.
permissions array An array of permissions strings. By default, the current permissions are inherited. Learn more about permissions.
transactionId string Transaction ID for staging the operation.
Response
200 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.updateRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // (optional)
permissions: ["read("any")"], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Update rows
Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
data object Row data as JSON object. Include only column and value pairs to be updated.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string Transaction ID for staging the operation.
Response
200 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
RowList result = await tablesDB.updateRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
data: {}, // (optional)
queries: [], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Upsert a row
Create or update a Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
rowId string requiredRow ID.
data object Row data as JSON object. Include all required columns of the row to be created or updated.
permissions array An array of permissions strings. By default, the current permissions are inherited. Learn more about permissions.
transactionId string Transaction ID for staging the operation.
Response
201 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PUT /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.upsertRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // (optional)
permissions: ["read("any")"], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Upsert rows
Create or update Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
rows array requiredArray of row data as JSON objects. May contain partial rows.
transactionId string Transaction ID for staging the operation.
Response
201 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PUT /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
RowList result = await tablesDB.upsertRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rows: [],
transactionId: '<TRANSACTION_ID>', // (optional)
);
Delete row
Delete a row by its unique ID.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
rowId string requiredRow ID.
transactionId string Transaction ID for staging the operation.
Response
204 no content
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 60 requests IP + METHOD + URL + USER ID
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
transactionId: '<TRANSACTION_ID>', // (optional)
);
Delete rows
Bulk delete rows using queries, if no queries are passed then all rows are deleted.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID. You can create a new table using the Database service server integration.
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries. Maximum of 100 queries are allowed, each 4096 characters long.
transactionId string Transaction ID for staging the operation.
Response
200 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 60 requests IP + METHOD + URL + USER ID
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Increment row column
Increment a specific column of a row by a given value.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
rowId string requiredRow ID.
column string requiredColumn key.
value number Value to increment the column by. The value must be a number.
max number Maximum value for the column. If the current value is greater than this value, an error will be thrown.
transactionId string Transaction ID for staging the operation.
Response
200 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.incrementRowColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
column: '',
value: 0, // (optional)
max: 0, // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Decrement row column
Decrement a specific column of a row by a given value.
Request
databaseId string requiredDatabase ID.
tableId string requiredTable ID.
rowId string requiredRow ID.
column string requiredColumn key.
value number Value to increment the column by. The value must be a number.
min number Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
transactionId string Transaction ID for staging the operation.
Response
200 application/json
Rate limits
This endpoint is not limited when using Server SDKs with API keys. If you are using SSR with
setSession
, these rate limits will still apply. Learn more about SSR rate limits.The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
TablesDB tablesDB = TablesDB(client);
Row result = await tablesDB.decrementRowColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
column: '',
value: 0, // (optional)
min: 0, // (optional)
transactionId: '<TRANSACTION_ID>', // (optional)
);
Create operations
Create multiple operations in a single transaction.
Request
transactionId string requiredTransaction ID.
operations array Array of staged operations.
Response
201 application/json
POST /tablesdb/transactions/{transactionId}/operations
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Transaction result = await tablesDB.createOperations(
transactionId: '<TRANSACTION_ID>',
operations: [
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"tableId": "<TABLE_ID>",
"rowId": "<ROW_ID>",
"data": {
"name": "Walter O'Brien"
}
}
], // (optional)
);
Create transaction
Create a new transaction.
Request
ttl integer Seconds before the transaction expires.
Response
201 application/json
POST /tablesdb/transactions
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Transaction result = await tablesDB.createTransaction(
ttl: 60, // (optional)
);
Get transaction
Get a transaction by its unique ID.
Request
transactionId string requiredTransaction ID.
Response
200 application/json
GET /tablesdb/transactions/{transactionId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Transaction result = await tablesDB.getTransaction(
transactionId: '<TRANSACTION_ID>',
);
List transactions
List transactions across all databases.
Request
queries array Array of query strings generated using the Query class provided by the SDK. Learn more about queries.
Response
200 application/json
GET /tablesdb/transactions
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
TransactionList result = await tablesDB.listTransactions(
queries: [], // (optional)
);
Update transaction
Update a transaction, to either commit or roll back its operations.
Request
transactionId string requiredTransaction ID.
commit boolean Commit transaction?
rollback boolean Rollback transaction?
Response
200 application/json
PATCH /tablesdb/transactions/{transactionId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
Transaction result = await tablesDB.updateTransaction(
transactionId: '<TRANSACTION_ID>',
commit: false, // (optional)
rollback: false, // (optional)
);
Delete transaction
Delete a transaction by its unique ID.
Request
transactionId string requiredTransaction ID.
Response
204 no content
DELETE /tablesdb/transactions/{transactionId}
import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setKey('<YOUR_API_KEY>'); // Your secret API key
TablesDB tablesDB = TablesDB(client);
await tablesDB.deleteTransaction(
transactionId: '<TRANSACTION_ID>',
);