-
Notifications
You must be signed in to change notification settings - Fork 294
Add csv export doc #2625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ebenezerdon
wants to merge
3
commits into
main
Choose a base branch
from
csv-export-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add csv export doc #2625
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
src/routes/docs/products/databases/csv-exports/+page.markdoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| --- | ||
| layout: article | ||
| title: CSV exports | ||
| description: Export table data to CSV files from the Console. Share clean datasets with your team without writing custom scripts. | ||
| --- | ||
|
|
||
| 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. | ||
|
|
||
| # Export configuration {% #export-configuration %} | ||
|
|
||
| Before exporting, you can configure several options to control the output format and contents. These settings ensure you get exactly the data you need in the format your tools expect. | ||
|
|
||
| ## Choose export location {% #export-location %} | ||
|
|
||
| You can select which [Storage bucket](/docs/products/storage/buckets) to export to and specify a custom filename for your CSV file. This gives you control over where your data is stored and makes it easier to organize multiple exports. | ||
|
|
||
| ## Apply queries {% #apply-queries %} | ||
|
|
||
| You can filter which rows to export using Appwrite's standard [query syntax](/docs/products/databases/queries). Only rows matching your query will be included in the export. This lets you create targeted exports for specific use cases without exporting unnecessary data. | ||
|
|
||
| For example, to export only active users who signed up in 2025: | ||
| ```text | ||
| status equals "active" AND $createdAt greaterThan "2025-01-01" | ||
| ``` | ||
|
|
||
| Learn more about [query operators](/docs/products/databases/queries#query-operators). | ||
|
|
||
| ## Select columns {% #select-columns %} | ||
|
|
||
| You can choose which columns to include in your export. By default, all columns are exported, but selecting specific columns creates cleaner, more focused datasets that are easier to work with in spreadsheets and analytics tools. | ||
|
|
||
| {% info title="Good to know" %} | ||
| System columns like `$id`, `$createdAt`, and `$updatedAt` can also be included or excluded based on your needs. | ||
| {% /info %} | ||
|
|
||
| ## Custom delimiter {% #custom-delimiter %} | ||
|
|
||
| You can set a custom delimiter for your CSV file. While commas are standard, you can use tabs, semicolons, or other delimiters based on your requirements or the tools you're importing into. | ||
|
|
||
| Common delimiters: | ||
| - **Comma (`,`)**: Standard format, compatible with most tools | ||
| - **Tab**: Useful when your data contains many commas | ||
| - **Semicolon (`;`)**: Common in European Excel versions | ||
|
|
||
| ## Header row {% #header-row %} | ||
|
|
||
| You can choose whether to include a header row with column names. Headers make it easier to understand the data in spreadsheets, but some import tools work better without them. | ||
|
|
||
| # Relationship handling {% #relationship-handling %} | ||
|
|
||
| When exporting data that includes [relationships](/docs/products/databases/relationships) to other tables, Appwrite exports only the related row IDs by default. This keeps your CSV files clean and prevents deeply nested data structures that can break spreadsheet tools. | ||
|
|
||
| For example, if you have a `posts` table with a relationship to an `authors` table, the export will include the author ID rather than all author details. | ||
|
|
||
| An example of exported data with relationships: | ||
|
|
||
| ```text | ||
| $id,title,author_id,published | ||
| post-1,Getting started with Appwrite,user-123,true | ||
| post-2,Advanced queries,user-456,true | ||
| post-3,CSV exports guide,user-123,false | ||
| ``` | ||
|
|
||
| # Timestamps {% #timestamps %} | ||
|
|
||
| The `$createdAt` and `$updatedAt` columns are exported in ISO 8601 format, making them compatible with most spreadsheet and database tools. | ||
|
|
||
| # Permissions {% #permissions %} | ||
|
|
||
| If row-level security is enabled for your table, the `$permissions` column will be included in the export. Permission strings are formatted as comma-separated role definitions within quotes. | ||
|
|
||
| ```text | ||
| $id,title,$permissions | ||
| post-1,Public post,"read(""any""),update(""user:user-123"")" | ||
| post-2,Team post,"read(""team:team-456""),update(""team:team-456"")" | ||
| ``` | ||
|
|
||
| The roles used are API strings that can be found in the [permissions documentation](/docs/products/databases/permissions). | ||
|
|
||
| # Background processing {% #background-processing %} | ||
|
|
||
| Large exports run as background tasks to avoid blocking your workflow. When an export completes, you'll receive an email with a short-lived download link to retrieve your CSV file. | ||
|
|
||
| This means you can start an export, close the Console, and return later to download your file. The Console displays a floating progress bar while the export is active. | ||
|
|
||
| # Export from the Console {% #export-console %} | ||
|
|
||
| To export rows using the Appwrite Console: | ||
|
|
||
| 1. Go to your project and navigate to **Databases** | ||
| 2. Select your target database and navigate to your target table | ||
| 3. Click on the **Export CSV** button in the action area | ||
| 4. Configure your export options: | ||
| - Select the Storage bucket and enter a filename | ||
| - Apply queries to filter rows (optional) | ||
| - Choose which columns to include (optional) | ||
| - Set your preferred delimiter | ||
| - Choose whether to include headers | ||
| 5. Click **Export** | ||
|
|
||
| {% only_dark %} | ||
|  | ||
| {% /only_dark %} | ||
| {% only_light %} | ||
|  | ||
| {% /only_light %} | ||
|
|
||
| The export will begin processing in the background. You'll see a progress indicator and receive an email when the export is ready to download. | ||
|
|
||
| # Use cases {% #use-cases %} | ||
|
|
||
| CSV exports are useful for many common workflows: | ||
|
|
||
| - **Reporting**: Generate reports for stakeholders who need data in spreadsheet format | ||
| - **Data sharing**: Share clean datasets with non-technical team members | ||
| - **Analytics hand-off**: Provide datasets to analysts using BI tools | ||
| - **Compliance exports**: Create audit trails and compliance records | ||
| - **Custom backups**: Archive specific data subsets for record-keeping | ||
| - **Migration preparation**: Extract data for migration to other systems | ||
|
|
||
| # Best practices {% #best-practices %} | ||
|
|
||
| To get the most out of CSV exports: | ||
|
|
||
| 1. **Use queries to filter data**: Export only the rows you need to reduce file size and processing time | ||
| 2. **Select specific columns**: Choose relevant columns to create cleaner, more focused datasets | ||
| 3. **Include system columns when needed**: Add `$id`, `$createdAt`, and `$updatedAt` for complete record tracking | ||
| 4. **Choose appropriate delimiters**: Use tabs or semicolons if your data contains many commas | ||
| 5. **Consider header requirements**: Include headers for human readability, exclude them for automated imports | ||
|
|
||
| # Additional resources {% #additional-resources %} | ||
|
|
||
| - [CSV Imports](/docs/products/databases/csv-imports) - Import data from CSV files | ||
| - [Queries](/docs/products/databases/queries) - Full query syntax reference | ||
| - [Relationships](/docs/products/databases/relationships) - Define connections between tables | ||
| - [Database Permissions](/docs/products/databases/permissions) - Configure row-level security | ||
| - [Database Backups](/docs/products/databases/backups) - Automated backup policies | ||
| - [Storage Buckets](/docs/products/storage/buckets) - Organize exported files | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify that the referenced images exist.
The documentation references two images that should be present in the repository. Ensure these files exist to avoid broken image links.
Run the following script to verify the images exist:
🏁 Script executed:
Length of output: 787
Missing image files will cause broken links in documentation.
The referenced images do not exist in the repository. The code references
/images/docs/databases/csv-export.pngand/images/docs/databases/dark/csv-export.png, but the script found similar images namedcsv-import.pnginstead. Either:csv-import.png)csv-export.pngimages are missing and need to be added tostatic/images/docs/databases/andstatic/images/docs/databases/dark/🤖 Prompt for AI Agents