Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 89 additions & 67 deletions src/routes/docs/products/databases/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<script lang="ts">
import { setContext } from 'svelte';
import { page } from '$app/state';
import { writable } from 'svelte/store';
import Docs from '$lib/layouts/Docs.svelte';
import { isNewUntil } from '$lib/utils/date';
import Sidebar, { type NavParent, type NavTree } from '$lib/layouts/Sidebar.svelte';
import type { HeaderSectionInfoAlert } from '$lib/layouts/DocsArticle.svelte';

let { children } = $props();

Expand All @@ -23,34 +20,18 @@
href: '/docs/products/databases'
},
{
label: 'Quick start',
href: '/docs/products/databases/quick-start'
label: 'Databases',
href: '/docs/products/databases/databases'
}
]
},
{
label: 'Concepts',
items: [
{
label: 'Databases',
href: '/docs/products/databases/databases'
},
{
label: 'Tables',
href: '/docs/products/databases/tables'
},
{
label: 'Rows',
href: '/docs/products/databases/rows'
},
{
label: 'Permissions',
href: '/docs/products/databases/permissions'
},
{
label: 'Relationships',
href: '/docs/products/databases/relationships'
},
{
label: 'Queries',
href: '/docs/products/databases/queries'
Expand All @@ -65,9 +46,8 @@
new: isNewUntil('31 Dec 2025')
},
{
label: 'Geo queries',
href: '/docs/products/databases/geo-queries',
new: isNewUntil('30 Sep 2025')
label: 'Pagination',
href: '/docs/products/databases/pagination'
},
{
label: 'Backups',
Expand All @@ -76,54 +56,114 @@
]
},
{
label: 'Journeys',
label: 'Tables DB',
collapsible: true,
initiallyCollapsed: false,
items: [
{
label: 'Pagination',
href: '/docs/products/databases/pagination'
label: 'Quick start',
href: '/docs/products/databases/tablesdb/quick-start'
},
{
label: 'Transactions',
href: '/docs/products/databases/transactions',
new: isNewUntil('31 Oct 2025')
label: 'Tables',
href: '/docs/products/databases/tables'
},
{
label: 'Type generation',
href: '/docs/products/databases/type-generation',
new: isNewUntil('31 Jul 2025')
label: 'Rows',
href: '/docs/products/databases/rows'
},
{
label: 'Offline sync',
href: '/docs/products/databases/offline'
label: 'Relationships',
href: '/docs/products/databases/tablesdb/relationships'
},
{
label: 'Transactions',
href: '/docs/products/databases/tablesdb/transactions'
},
{
label: 'Bulk operations',
href: '/docs/products/databases/bulk-operations',
new: isNewUntil('31 Jul 2025')
href: '/docs/products/databases/tablesdb/bulk-operations'
},
{
label: 'Atomic numeric operations',
href: '/docs/products/databases/atomic-numeric-operations',
new: isNewUntil('31 Jul 2025')
href: '/docs/products/databases/tablesdb/atomic-numeric-operations'
},
{
label: 'Type generation',
href: '/docs/products/databases/tablesdb/type-generation'
},
{
label: 'Timestamp overrides',
href: '/docs/products/databases/tablesdb/timestamp-overrides'
},
{
label: 'Geo queries',
href: '/docs/products/databases/geo-queries'
},
{
label: 'CSV imports',
href: '/docs/products/databases/csv-imports',
new: isNewUntil('31 Jul 2025')
href: '/docs/products/databases/csv-imports'
},
{
label: 'CSV exports',
href: '/docs/products/databases/csv-exports',
new: isNewUntil('28 Feb 2026')
href: '/docs/products/databases/csv-exports'
}
]
},
{
label: 'Documents DB',
collapsible: true,
initiallyCollapsed: true,
items: [
{
label: 'Quick start',
href: '/docs/products/databases/documentsdb/quick-start'
},
{
label: 'Collections',
href: '/docs/products/databases/documentsdb/collections'
},
{
label: 'Documents',
href: '/docs/products/databases/documentsdb/documents'
},
{
label: 'Relationships',
href: '/docs/products/databases/documentsdb/relationships'
},
{
label: 'Transactions',
href: '/docs/products/databases/documentsdb/transactions'
},
{
label: 'Bulk operations',
href: '/docs/products/databases/documentsdb/bulk-operations'
},
{
label: 'Atomic numeric operations',
href: '/docs/products/databases/documentsdb/atomic-numeric-operations'
},
{
label: 'Type generation',
href: '/docs/products/databases/documentsdb/type-generation'
},
{
label: 'Timestamp overrides',
href: '/docs/products/databases/documentsdb/timestamp-overrides'
}
]
},
{
label: 'Journeys',
items: [
{
label: 'AI suggestions',
href: '/docs/products/databases/ai-suggestions',
new: isNewUntil('31 Dec 2025')
},
{
label: 'Timestamp overrides',
href: '/docs/products/databases/timestamp-overrides'
label: 'Offline sync',
href: '/docs/products/databases/offline'
}
]
},
Expand All @@ -135,6 +175,10 @@
href: '/docs/references/cloud/client-web/tablesDB',
new: isNewUntil('31 Oct 2025')
},
{
label: 'DocumentsDB API',
href: '/docs/references/cloud/client-web/documentsDB'
},
{
label: 'Legacy API',
href: '/docs/references/cloud/client-web/databases'
Expand All @@ -149,28 +193,6 @@
.replace('rows', 'documents')
.replace('tables', 'collections')
);

const hideSubtitleRoutes = ['offline', 'backups', 'csv-imports', 'csv-exports'];

const shouldShowSubtitle = $derived(
!hideSubtitleRoutes.some((segment) => page.route.id?.includes(segment)) &&
!page.url.pathname.endsWith('products/databases')
);

const headerSectionInfoAlert = writable<HeaderSectionInfoAlert | null>(null);

$effect(() => {
if (shouldShowSubtitle) {
headerSectionInfoAlert.set({
title: 'New API',
description: `This is a relatively new API. For details on the previous version and its terminology, see the legacy <a class="web-link underline" href="${legacyUrl}">Collections API documentation</a>.`
});
} else {
headerSectionInfoAlert.set(null);
}
});

setContext('headerSectionInfoAlert', headerSectionInfoAlert);
</script>

<Docs variant="two-side-navs">
Expand Down
22 changes: 18 additions & 4 deletions src/routes/docs/products/databases/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@ title: Databases
description: Store and query structured data with Appwrite Databases. Databases provide performant and scalable storage for your application, business, and user data.
---

Appwrite Databases let you store and query structured data.
Appwrite Databases let you store and query structured data.
Databases provide high-performance and scalable data storage for your key application, business, and user data.

{% info title="Looking for file storage?" %}
Databases store data, if you need to store files like images, PDFs or videos, use [Appwrite Storage](/docs/products/storage).
{% /info %}

You can organize data into databases, tables, and rows. You can also paginate, order, and query rows.
Appwrite supports two database backends, each optimized for different workloads:

| | Tables DB | Documents DB |
|---|---|---|
| **Backed by** | MariaDB (SQL) | MongoDB (NoSQL) |
| **Terminology** | Tables, rows, columns | Collections, documents, attributes |
| **Best for** | Relational data, geo queries, CSV workflows | Flexible schemas, large attribute counts |
| **Spatial/Geo** | Full support | Not available |
| **CSV import/export** | Supported | Not available |

You can organize data into databases, tables (or collections), and rows (or documents). You can also paginate, order, and query your data.
For complex business logic, Appwrite supports relationships to help you model your data.

{% arrow_link href="/docs/products/databases/quick-start" %}
Quick start
{% arrow_link href="/docs/products/databases/tablesdb/quick-start" %}
Get started with Tables DB
{% /arrow_link %}

{% arrow_link href="/docs/products/databases/documentsdb/quick-start" %}
Get started with Documents DB
{% /arrow_link %}
20 changes: 10 additions & 10 deletions src/routes/docs/products/databases/ai-suggestions/+page.markdoc
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
layout: article
title: AI suggestions
description: Use AI suggestions to automatically generate database schemas. Learn how to create tables with recommended columns and indexes based on your table name and context.
description: Use AI suggestions to automatically generate database schemas. Learn how to create tables or collections with recommended columns/attributes and indexes based on your name and context.
---
AI suggestions generate columns and indexes for your tables based on the table name, existing database structure, and optional context you provide.
AI suggestions generate columns (Tables DB) or attributes (Documents DB) and indexes for your tables or collections based on the name, existing database structure, and optional context you provide.
This feature analyzes your database to recommend appropriate schema designs that follow best practices.

{% section #create-table step=1 title="Create table" %}
Navigate to **Databases** in the Appwrite Console, select your database, and click **Create table**.
{% section #create-table step=1 title="Create table or collection" %}
Navigate to **Databases** in the Appwrite Console, select your database, and click **Create table** (Tables DB) or **Create collection** (Documents DB).

Enter a descriptive table name. AI suggestions will use this name to generate relevant columns and indexes.
Enter a descriptive name. AI suggestions will use this name to generate relevant columns/attributes and indexes.
{% /section %}

{% section #enable-suggestions step=2 title="Enable AI suggestions" %}
In the table creation dialog, enable **AI suggestions**.
In the table or collection creation dialog, enable **AI suggestions**.

{% only_dark %}
![Enable AI suggestions](/images/docs/databases/dark/ai-suggestions-enable.png)
Expand All @@ -22,13 +22,13 @@ In the table creation dialog, enable **AI suggestions**.
![Enable AI suggestions](/images/docs/databases/ai-suggestions-enable.png)
{% /only_light %}

Optionally, provide additional context about your use case to refine the suggestions. For example, if creating an `Orders` table, you might add context like "e-commerce orders with payment tracking."
Optionally, provide additional context about your use case to refine the suggestions. For example, if creating an `Orders` table or collection, you might add context like "e-commerce orders with payment tracking."

Click **Generate suggestions** to analyze your table name and database structure.
Click **Generate suggestions** to analyze your table or collection name and database structure.
{% /section %}

{% section #review-suggestions step=3 title="Review suggestions" %}
AI suggestions will generate recommended columns and indexes for your table.
AI suggestions will generate recommended columns or attributes and indexes for your table or collection.

{% only_dark %}
![Review AI suggestions](/images/docs/databases/dark/ai-suggestions-review.png)
Expand All @@ -52,7 +52,7 @@ You can modify any suggestion before applying:
- Remove suggestions you don't need
- Add additional columns manually

Click **Apply** to apply your schema. The table will be created with your approved columns and indexes.
Click **Apply** to apply your schema. The table or collection will be created with your approved columns or attributes and indexes.

{% info title="Manual columns" %}
You can always add, modify, or remove [columns](/docs/products/databases/tables#columns) after table creation by navigating to your table's **Columns** tab.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { PageLoad } from './$types';
import { redirect } from '@sveltejs/kit';

export const load: PageLoad = async () => {
redirect(303, '/docs/products/databases/tablesdb/atomic-numeric-operations');
};
6 changes: 6 additions & 0 deletions src/routes/docs/products/databases/bulk-operations/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { PageLoad } from './$types';
import { redirect } from '@sveltejs/kit';

export const load: PageLoad = async () => {
redirect(303, '/docs/products/databases/tablesdb/bulk-operations');
};
4 changes: 4 additions & 0 deletions src/routes/docs/products/databases/csv-exports/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: CSV exports
description: Export table data to CSV files from the Console. Share clean datasets with your team without writing custom scripts.
---

{% info title="Tables DB only" %}
CSV exports are only available with **Tables DB** (MariaDB). Documents DB (MongoDB) does not support CSV exports.
{% /info %}

Appwrite's CSV Export feature allows you to export rows from a table to a CSV file. This is especially useful for reporting, sharing data with non-technical team members, creating custom backups, or handing off datasets to analytics tools.

This feature is available in both Appwrite Cloud and the self-hosted version.
Expand Down
4 changes: 4 additions & 0 deletions src/routes/docs/products/databases/csv-imports/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: CSV imports
description: Master row imports with Appwrite's CSV Import feature. Learn how to create rows within your tables by uploading a CSV file.
---

{% info title="Tables DB only" %}
CSV imports are only available with **Tables DB** (MariaDB). Documents DB (MongoDB) does not support CSV imports.
{% /info %}

Appwrite's CSV Import feature allows you to create multiple rows in a table by uploading a single CSV file. This is especially useful for importing existing data, seeding test environments, or migrating from other systems.

This feature is available in both Appwrite Cloud and the self-hosted version.
Expand Down
7 changes: 5 additions & 2 deletions src/routes/docs/products/databases/databases/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ title: Databases
description: Dive deeper into Appwrite Databases and their configuration. Learn how to create, manage, and optimize multiple databases for your application.
---
Databases are the largest organizational unit in Appwrite.
Each database contains a group of [tables](/docs/products/databases/tables).
In future versions, different databases may be backed by a different database technology of your choosing.
Each database contains a group of [tables](/docs/products/databases/tables) (Tables DB) or [collections](/docs/products/databases/documentsdb/collections) (Documents DB).

{% info title="Terminology mapping" %}
Code examples on this page use Tables DB (`TablesDB`). For Documents DB, use `DocumentsDB` instead of `TablesDB`.
{% /info %}

# Create in Console {% #create-in-console %}
The easiest way to create a database using the Appwrite Console.
Expand Down
Loading