Docs
Skip to content

Databases

Tables_

Organize your data with Appwrite Tables. Explore how to create and configure tables to store and structure your data effectively.

4 min read

Raw

Appwrite uses tables as containers of rows. Each tables contains many rows identical in structure. The terms tables and rows are used because the Appwrite JSON REST API resembles the API of a traditional NoSQL database, making it intuitive and user-friendly, even though Appwrite uses SQL under the hood.

That said, Appwrite is designed to support both SQL and NoSQL database adapters like MariaDB, MySQL, or MongoDB in future versions.

Create table

You can create tables using the Appwrite Console, a Server SDK, or using the CLI.

Permissions

Appwrite uses permissions to control data access. For security, only users that are granted permissions can access a resource. This helps prevent accidental data leaks by forcing you to make more conscious decisions around permissions.

By default, Appwrite doesn't grant permissions to any users when a new table is created. This means users can't create new rows or read, update, and delete existing rows.

Learn about configuring permissions.

Columns

All rows in a table follow the same structure. Columns are used to define the structure of your rows and help the Appwrite's API validate your users' input. Add your first column by clicking the Add column button.

You can choose between the following types.

ColumnDescription
varcharString column. Fully indexable if size < 768. Maximum 16,383 characters.
textText column. Prefix indexing only. Maximum 16,383 characters.
mediumtextText column. Prefix indexing only. Maximum 4,194,303 characters.
longtextText column. Prefix indexing only. Maximum 1,073,741,823 characters.
integerInteger column. 32-bit signed, range -2,147,483,648 to 2,147,483,647.
bigintBig integer column. 64-bit signed, range -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Ideal for timestamps, large counters, or IDs that exceed 32-bit limits.
floatFloat column.
booleanBoolean column.
datetimeDatetime column formatted as an ISO 8601 string.
enumEnum column.
ipIP address column for IPv4 and IPv6.
emailEmail address column.
urlURL column.
pointGeographic point specified as [longitude, latitude].
lineGeographic line represented by an ordered list of coordinates.
polygonGeographic polygon representing a closed area; supports interior holes.
relationshipRelationship column relates one table to another. Learn more about relationships.
stringDeprecated. Use varchar, text, mediumtext, or longtext instead.

If an column must be populated in all rows, set it as required. If not, you may optionally set a default value. Additionally, decide if the column should be a single value or an array of values.

If needed, you can change an column's key, default value, size (for text columns), and whether it is required or not after creation.

You can increase a varchar column's size without any restrictions. When decreasing size, you must ensure that your existing data is less than or equal to the new size, or the operation will fail.

Indexes

Databases use indexes to quickly locate data without having to search through every row for matches. To ensure the best performance, Appwrite recommends an index for every column queried. If you plan to query multiple columns in a single query, creating an index with all queried columns will yield optimal performance.

The following indexes are currently supported:

TypeDescription
keyPlain Index to allow queries.
uniqueUnique Index to disallow duplicates.
fulltextFor searching within text columns. Required for the search query method.

You can create an index by navigating to your table's Indexes tab or by using your favorite Server SDK.

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.