Skip to content

TablesDB

SERVER

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.

Base URL
https://<REGION>.cloud.appwrite.io/v1

Create database

Create a new Database.

  • Request
    • databaseId string
      required

      Unique 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
      required

      Database 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
Endpoint
POST /tablesdb
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create(
        "<DATABASE_ID>",
        "<NAME>",
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get database

Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.

  • Request
    • databaseId string
      required

      Database ID.

  • Response
Endpoint
GET /tablesdb/{databaseId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get(
        "<DATABASE_ID>"
    ).await?;

    let _ = result;

    Ok(())
}

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.

    • total boolean

      When set to false, the total count returned will be 0 and will not be calculated.

  • Response
Endpoint
GET /tablesdb
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list(
        Some(vec![]), // optional
        Some("<SEARCH>"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update database

Update a database by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • name string

      Database 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
Endpoint
PUT /tablesdb/{databaseId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update(
        "<DATABASE_ID>",
        Some("<NAME>"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete database

Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.

  • Request
    • databaseId string
      required

      Database ID.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    tables_db.delete(
        "<DATABASE_ID>"
    ).await?;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Unique 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
      required

      Table name. Max length: 128 chars.

    • 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.

    • columns array

      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.

    • indexes array

      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).

  • Response
    • 201 application/json
Endpoint
POST /tablesdb/{databaseId}/tables
Rust
use appwrite::Client;
use appwrite::services::TablesDB;
use appwrite::permission::Permission;
use appwrite::role::Role;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_table(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<NAME>",
        Some(vec![Permission::read(Role::any()).to_string()]), // optional
        Some(false), // optional
        Some(false), // optional
        Some(vec![]), // optional
        Some(vec![]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get table

Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

  • Response
    • 200 application/json
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get_table(
        "<DATABASE_ID>",
        "<TABLE_ID>"
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database 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.

    • total boolean

      When set to false, the total count returned will be 0 and will not be calculated.

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list_tables(
        "<DATABASE_ID>",
        Some(vec![]), // optional
        Some("<SEARCH>"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update table

Update a table by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • name string

      Table name. Max length: 128 chars.

    • 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.

    • purge boolean

      When true, purge all cached list responses for this table as part of the update. Use this to force readers to see fresh data immediately instead of waiting for the cache TTL to expire.

  • Response
    • 200 application/json
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;
use appwrite::permission::Permission;
use appwrite::role::Role;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_table(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some("<NAME>"), // optional
        Some(vec![Permission::read(Role::any()).to_string()]), // optional
        Some(false), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete table

Delete a table by its unique ID. Only users with write permissions have access to delete this resource.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    tables_db.delete_table(
        "<DATABASE_ID>",
        "<TABLE_ID>"
    ).await?;

    Ok(())
}

Create boolean column

Create a boolean column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/boolean
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_boolean_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create datetime column

Create a date time column according to the ISO 8601 standard.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/datetime
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_datetime_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("2020-10-15T06:38:00.000+00:00"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create email column

Create an email column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/email
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_email_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("email@example.com"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create enum column

Create an enumeration column. The elements param acts as a white-list of accepted values for this column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • elements array
      required

      Array of enum values.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/enum
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_enum_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        vec![],
        false,
        Some("<DEFAULT>"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create float column

Create a float column. Optionally, minimum and maximum values can be provided.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/float
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_float_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(0), // optional
        Some(0), // optional
        Some(0), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create integer column

Create an integer column. Optionally, minimum and maximum values can be provided.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/integer
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_integer_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(0), // optional
        Some(0), // optional
        Some(0), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create IP address column

Create IP address column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string

      Default value. Cannot be set when column is required.

    • array boolean

      Is column an array?

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/ip
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_ip_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(""), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create line column

Create a geometric line column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/line
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_line_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create longtext column

Create a longtext column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/longtext
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_longtext_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("<DEFAULT>"), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create mediumtext column

Create a mediumtext column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_mediumtext_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("<DEFAULT>"), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create point column

Create a geometric point column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/point
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_point_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![1, 2]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create polygon column

Create a geometric polygon column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/polygon
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_polygon_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create relationship column

Create relationship column. Learn more about relationship columns.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • relatedTableId string
      required

      Related Table ID.

    • type string
      required

      Relation type

    • twoWay boolean

      Is Two Way?

    • key string

      Column Key.

    • twoWayKey string

      Two Way Column Key.

    • onDelete string

      Constraints option

  • Response
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/relationship
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_relationship_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<RELATED_TABLE_ID>",
        appwrite::enums::RelationshipType::OneToOne,
        Some(false), // optional
        Some(""), // optional
        Some(""), // optional
        Some(appwrite::enums::RelationMutate::Cascade) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create string column

Create a string column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • size integer
      required

      Column size for text columns, in number of characters.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/string
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_string_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        1,
        false,
        Some("<DEFAULT>"), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create text column

Create a text column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/text
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_text_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("<DEFAULT>"), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create URL column

Create a URL column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/url
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_url_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some("https://example.com"), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create varchar column

Create a varchar column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • size integer
      required

      Column size for varchar columns, in number of characters. Maximum size is 16381.

    • required boolean
      required

      Is 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/columns/varchar
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_varchar_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        1,
        false,
        Some("<DEFAULT>"), // optional
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get column

Get column by ID.

Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        ""
    ).await?;

    let _ = result;

    Ok(())
}

List columns

List columns in the table.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table 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

    • total boolean

      When set to false, the total count returned will be 0 and will not be calculated.

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/columns
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list_columns(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some(vec![]), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update boolean column

Update a boolean column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default boolean
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_boolean_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        false,
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update dateTime column

Update a date time column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_datetime_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "2020-10-15T06:38:00.000+00:00",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update email column

Update an email column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_email_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "email@example.com",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update enum column

Update an enum column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • elements array
      required

      Updated list of enum values.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_enum_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        vec![],
        false,
        "<DEFAULT>",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update float column

Update a float column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default number
      required

      Default value. Cannot be set when required.

    • min number

      Minimum value

    • max number

      Maximum value

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_float_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        0,
        Some(0), // optional
        Some(0), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update integer column

Update an integer column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default integer
      required

      Default value. Cannot be set when column is required.

    • min integer

      Minimum value

    • max integer

      Maximum value

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_integer_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        0,
        Some(0), // optional
        Some(0), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update IP address column

Update an ip column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_ip_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update line column

Update a line column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_line_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![serde_json::json!([1,2]), serde_json::json!([3,4]), serde_json::json!([5,6])]), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update longtext column

Update a longtext column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_longtext_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "<DEFAULT>",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update mediumtext column

Update a mediumtext column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_mediumtext_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "<DEFAULT>",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update point column

Update a point column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_point_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![1, 2]), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update polygon column

Update a polygon column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is 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
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_polygon_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        Some(vec![serde_json::json!([[1,2],[3,4],[5,6],[1,2]])]), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update relationship column

Update relationship column. Learn more about relationship columns.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • onDelete string

      Constraints option

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_relationship_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        Some(appwrite::enums::RelationMutate::Cascade), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update string column

Update a string column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default 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
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_string_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "<DEFAULT>",
        Some(1), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update text column

Update a text column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_text_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "<DEFAULT>",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update URL column

Update an url column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_url_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "https://example.com",
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update varchar column

Update a varchar column. Changing the default value will not update already existing rows.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Column Key.

    • required boolean
      required

      Is column required?

    • default string
      required

      Default value for column when not provided. Cannot be set when column is required.

    • size integer

      Maximum size of the varchar column.

    • newKey string

      New Column Key.

  • Response
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_varchar_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        false,
        "<DEFAULT>",
        Some(1), // optional
        Some("") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete column

Deletes a column.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • key string
      required

      Column Key.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/columns/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    tables_db.delete_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        ""
    ).await?;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Index Key.

    • type string
      required

      Index type.

    • columns array
      required

      Array 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
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/indexes
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_index(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "",
        appwrite::enums::TablesDBIndexType::Key,
        vec![],
        Some(vec![appwrite::enums::OrderBy::Asc]), // optional
        Some(vec![]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get index

Get index by ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • key string
      required

      Index Key.

  • Response
    • 200 application/json
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get_index(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        ""
    ).await?;

    let _ = result;

    Ok(())
}

List indexes

List indexes on the table.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table 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

    • total boolean

      When set to false, the total count returned will be 0 and will not be calculated.

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/indexes
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list_indexes(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some(vec![]), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete index

Delete an index.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the TablesDB service server integration.

    • key string
      required

      Index Key.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/indexes/{key}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    tables_db.delete_index(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        ""
    ).await?;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;
use appwrite::permission::Permission;
use appwrite::role::Role;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_row(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        serde_json::json!({}),
        Some(vec![Permission::read(Role::any()).to_string()]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table 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
  • 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
POST /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_rows(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        vec![],
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get row

Get a row by its unique ID. This endpoint response returns a JSON object with the row data.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • rowId string
      required

      Row 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
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get_row(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        Some(vec![]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table 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.

    • total boolean

      When set to false, the total count returned will be 0 and will not be calculated.

    • ttl integer

      TTL (seconds) for caching list responses. Responses are stored in an in-memory key-value cache, keyed per project, table, schema version (columns and indexes), caller authorization roles, and the exact query — so users with different permissions never share cached entries. Schema changes invalidate cached entries automatically; row writes do not, so choose a TTL you are comfortable serving as stale data. Set to 0 to disable caching. Must be between 0 and 86400 (24 hours).

  • Response
Endpoint
GET /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list_rows(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some(vec![]), // optional
        Some("<TRANSACTION_ID>"), // optional
        Some(false), // optional
        Some(0) // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • data object

      Row data as JSON object. Include only columns and value pairs to be updated.

    • 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;
use appwrite::permission::Permission;
use appwrite::role::Role;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_row(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        Some(serde_json::json!({})), // optional
        Some(vec![Permission::read(Role::any()).to_string()]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table 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
  • 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_rows(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some(serde_json::json!({})), // optional
        Some(vec![]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • data object

      Row data as JSON object. Include all required columns of the row to be created or updated.

    • 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;
use appwrite::permission::Permission;
use appwrite::role::Role;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.upsert_row(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        Some(serde_json::json!({})), // optional
        Some(vec![Permission::read(Role::any()).to_string()]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

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
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rows array
      required

      Array of row data as JSON objects. May contain partial rows.

    • transactionId string

      Transaction ID for staging the operation.

  • Response
  • 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PUT /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.upsert_rows(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        vec![],
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete row

Delete a row by its unique ID.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID. You can create a new table using the Database service server integration.

    • rowId string
      required

      Row 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 frame
    Attempts
    Key
    1 minutes60 requestsIP + METHOD + URL + USER ID
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    tables_db.delete_row(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    Ok(())
}

Delete rows

Bulk delete rows using queries, if no queries are passed then all rows are deleted.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table 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
  • 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 frame
    Attempts
    Key
    1 minutes60 requestsIP + METHOD + URL + USER ID
Endpoint
DELETE /tablesdb/{databaseId}/tables/{tableId}/rows
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.delete_rows(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        Some(vec![]), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Increment row column

Increment a specific column of a row by a given value.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • column string
      required

      Column 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.increment_row_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        "",
        Some(0), // optional
        Some(0), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Decrement row column

Decrement a specific column of a row by a given value.

  • Request
    • databaseId string
      required

      Database ID.

    • tableId string
      required

      Table ID.

    • rowId string
      required

      Row ID.

    • column string
      required

      Column 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 frame
    Attempts
    Key
    1 minutes120 requestsIP + METHOD + URL + USER ID
Endpoint
PATCH /tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_session(""); // The user session to authenticate with

    let tables_db = TablesDB::new(&client);

    let result = tables_db.decrement_row_column(
        "<DATABASE_ID>",
        "<TABLE_ID>",
        "<ROW_ID>",
        "",
        Some(0), // optional
        Some(0), // optional
        Some("<TRANSACTION_ID>") // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create operations

Create multiple operations in a single transaction.

  • Request
    • transactionId string
      required

      Transaction ID.

    • operations array

      Array of staged operations.

  • Response
Endpoint
POST /tablesdb/transactions/{transactionId}/operations
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_operations(
        "<TRANSACTION_ID>",
        Some(vec![serde_json::json!({"action":"create","databaseId":"<DATABASE_ID>","tableId":"<TABLE_ID>","rowId":"<ROW_ID>","data":{"name":"Walter O'Brien"}})]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Create transaction

Create a new transaction.

  • Request
    • ttl integer

      Seconds before the transaction expires.

  • Response
Endpoint
POST /tablesdb/transactions
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.create_transaction(
        Some(60) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Get transaction

Get a transaction by its unique ID.

  • Request
    • transactionId string
      required

      Transaction ID.

  • Response
Endpoint
GET /tablesdb/transactions/{transactionId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.get_transaction(
        "<TRANSACTION_ID>"
    ).await?;

    let _ = result;

    Ok(())
}

List transactions

List transactions across all databases.

Endpoint
GET /tablesdb/transactions
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.list_transactions(
        Some(vec![]) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Update transaction

Update a transaction, to either commit or roll back its operations.

  • Request
    • transactionId string
      required

      Transaction ID.

    • commit boolean

      Commit transaction?

    • rollback boolean

      Rollback transaction?

  • Response
Endpoint
PATCH /tablesdb/transactions/{transactionId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    let result = tables_db.update_transaction(
        "<TRANSACTION_ID>",
        Some(false), // optional
        Some(false) // optional
    ).await?;

    let _ = result;

    Ok(())
}

Delete transaction

Delete a transaction by its unique ID.

  • Request
    • transactionId string
      required

      Transaction ID.

  • Response
    • 204 no content
Endpoint
DELETE /tablesdb/transactions/{transactionId}
Rust
use appwrite::Client;
use appwrite::services::TablesDB;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1"); // Your API Endpoint
    client.set_project("<YOUR_PROJECT_ID>"); // Your project ID
    client.set_key("<YOUR_API_KEY>"); // Your secret API key

    let tables_db = TablesDB::new(&client);

    tables_db.delete_transaction(
        "<TRANSACTION_ID>"
    ).await?;

    Ok(())
}