Skip to content

Commit ec8ebe4

Browse files
authored
Merge pull request #2133 from appwrite/add-csv-import-docs
Add csv import docs
2 parents add1d88 + f6a684a commit ec8ebe4

File tree

10 files changed

+147
-8
lines changed

10 files changed

+147
-8
lines changed

STYLE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,21 @@ the tone and voice remains consistent.
144144
- All titles, headings, buttons, and labels should be written in **sentence case**. If you're not sure what sentence case should look like, check [APA's style guide](https://apastyle.apa.org/style-grammar-guidelines/capitalization/sentence-case) or check with ChatGPT and other LLMs which reliably converts titles to sentence case.
145145
- All headings in a docs page begin with `# Heading` then `## Heading` and `### Heading`. Internally, they're converted to H2 to H4 tags.
146146
- All headings should have an ID label, for example `# Cool heading {% #cool-heading %}` the `#cool-heading` ID will be used to generate the table of contents and add links to the heading.
147-
- Prefer verbs over gerunds, for example, say "Create documents" not "Creating documents".
147+
- Prefer verbs to gerunds, for example, say "Create documents" not "Creating documents".
148148

149149
### Extended Markdoc components
150150

151-
Appwrite's documentation uses extended markdown syntax. You can find all of the available partials types in the [CONTENT.md file](./CONTENT.md).
151+
Appwrite's documentation uses extended Markdown syntax. You can find all the available partials types in the [CONTENT.md file](./CONTENT.md).
152152

153153
### Screenshots
154154

155155
- When contributing upload original screenshots. The Appwrite design team will edit the screenshot to be consistent with other screenshots in the docs.
156156
- Screenshots must be 16:9
157-
- Screnshots should be taken in a 1400 x 900 view port on 3x DPR in browser developer tools.
157+
- Screenshots should be taken in a 1400 x 900 view port on 3x DPR in browser developer tools.
158158
- Use generic and sensible organization, project, and resource names. Avoid names like `test`, `demo`, or `sdlkfj`.
159-
- All screenshot should be take from a user named Walter O'Brien. You can change the name of your current user by going to your Appwrite Console and clicking the **top right profile icon** > **Your Account** > **Name**.
159+
- All screenshot should be taken from a user named Walter O'Brien. You can change the name of your current user by going to your Appwrite Console and clicking the **top right profile icon** > **Your Account** > **Name**.
160160
- Screenshots are stored in the `/images/docs/` folder, in a parent folder that is consistent with the path of the docs that reference the image.
161-
- All screenshots must be both dark and light mode, with `/path/` holding the lightmode version and `/path/dark/` holding the dark mode version.
161+
- All screenshots must be both dark and light mode, with `/path/` holding the light-mode version and `/path/dark/` holding the dark mode version.
162162
- Screenshots should be uploaded as un-edited original. Request help from the Appwrite design team to help you edit and refine your photos according to our guidelines.
163163

164164
```md

src/markdoc/nodes/Image.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{/if}
4343
{:else}
4444
<div class="web-media main">
45-
<img {src} {alt} {title} loading="lazy" class="aspect-video w-full" />
45+
<img {src} {alt} {title} loading="lazy" class="aspect-video w-full object-cover" />
4646
<div class="abs">
4747
<Tooltip closeOnPointerDown>
4848
<Button variant="secondary" class="cursor-pointer" action={trigger}>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
layout: post
3+
title: "Announcing: Document imports from CSV files"
4+
description: Learn how to import documents into your Appwrite collections using a simple CSV file, a new feature built on top of Appwrite's migration APIs.
5+
date: 2025-07-01
6+
# update this cover later, once available!
7+
cover: /images/blog/announcing-csv-imports/cover.png
8+
timeToRead: 5
9+
author: darshan-pandya
10+
category: announcement
11+
featured: false
12+
---
13+
14+
We're introducing a new way to populate your Appwrite databases: **document imports from CSV files**.
15+
16+
Built on top of Appwrite's migration APIs, this feature makes it easy to bring in large datasets, seed collections, or migrate structured data using only a CSV file.
17+
18+
The CSV document import is useful for migrating user data from external systems, importing inventory records, seeding test environments, or onboarding structured content such as FAQs.
19+
20+
# How it works
21+
22+
To get started, create a collection and define its attributes in the Appwrite Console. Your CSV file should follow a standard format:
23+
24+
- The first row must be a header containing attribute names that match your collection
25+
- Each subsequent row represents a document, with values separated by commas
26+
27+
{% info title="Good to know" %}
28+
You can optionally include the `$id` column to assign custom document IDs.
29+
{% /info %}
30+
31+
![Collections screen](/images/blog/announcing-csv-imports/csv-import.png)
32+
33+
All required attributes must be present in the CSV, and Appwrite will validate each row before importing it.
34+
35+
For example, if your collection contains attributes like `title`, `author`, `year`, and `available`, a valid CSV file would look like this:
36+
37+
```text
38+
$id,title,author,year,available
39+
f3k91x8b2q,Harry Potter and the Sorcerer's Stone,J.K. Rowling,1997,true
40+
mz7lq3dp5c,The Fellowship of the Ring,J.R.R. Tolkien,1954,true
41+
x0v4p8ncq2,To Kill a Mockingbird,Harper Lee,1960,false
42+
kq9nmv13ru,The Great Gatsby,F. Scott Fitzgerald,1925,true
43+
p8lw39xsd1,Catch-22,Joseph Heller,1961,true
44+
v42cj0quxp,Pride and Prejudice,Jane Austen,1813,true
45+
```
46+
47+
## Uploading your CSV file
48+
49+
You can upload a new file during import or select an existing one from your project's storage bucket.
50+
The Console provides a guided interface to help you select the CSV and link it to your target collection. Once uploaded, the import process begins immediately.
51+
52+
## Designed for scale
53+
54+
CSV imports are built to scale seamlessly with your data. Whether you're working with a small dataset or importing production-grade records, the system is designed to handle high volumes reliably and efficiently.
55+
56+
The import system performs per-row validation and runs as a background task, allowing it to handle large files efficiently. This ensures reliable performance across a range of scenarios—from lightweight configuration data to large-scale production imports.
57+
58+
## Availability and resources
59+
60+
CSV imports are now available on **Appwrite Cloud** and in the latest self-hosted release.
61+
62+
To learn more, check out the [official documentation](/docs/products/databases/csv-imports).
63+
If you have any questions or feedback, we'd love to hear from you in the [Appwrite Discord community](https://discord.gg/appwrite).
64+
65+
# Further reading
66+
67+
- [Introducing Database Backups](https://appwrite.io/blog/post/introducing-database-backups?doFollow=true)
68+
- [Best database pagination technique](https://appwrite.io/blog/post/best-pagination-technique?doFollow=true)
69+
- [How to plan and execute database migration successfully with the new Appwrite CLI](https://appwrite.io/blog/post/how-to-execute-database-migration-with-appwrite-cli?doFollow=true)

src/routes/docs/products/databases/+layout.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import Docs from '$lib/layouts/Docs.svelte';
3+
import { isNewUntil } from '$lib/utils/date';
34
import Sidebar, { type NavParent, type NavTree } from '$lib/layouts/Sidebar.svelte';
45
56
const parent: NavParent = {
@@ -42,7 +43,8 @@
4243
},
4344
{
4445
label: 'Type Generation',
45-
href: '/docs/products/databases/type-generation'
46+
href: '/docs/products/databases/type-generation',
47+
new: isNewUntil('31 Jul 2025')
4648
},
4749
{
4850
label: 'Offline Sync',
@@ -55,6 +57,11 @@
5557
{
5658
label: 'Backups',
5759
href: '/docs/products/databases/backups'
60+
},
61+
{
62+
label: 'CSV Imports',
63+
href: '/docs/products/databases/csv-imports',
64+
new: isNewUntil('31 Jul 2025')
5865
}
5966
]
6067
},
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: article
3+
title: CSV Imports
4+
description: Master document imports with Appwrite's CSV Import feature. Learn how to create documents within your collections by uploading a CSV file.
5+
---
6+
7+
Appwrite's CSV Import feature allows you to create multiple documents in a collection by uploading a single CSV file. This is especially useful for importing existing data, seeding test environments, or migrating from other systems.
8+
9+
This feature is available in both Appwrite Cloud and the self-hosted version.
10+
11+
# Prepare your collection {% #prepare-collection %}
12+
13+
To get started, create a collection in your database and define its attributes. Your CSV file must match the structure of this collection.
14+
15+
Each column in the CSV should map to an attribute key in your collection, and each row should represent a new document.
16+
17+
{% info title="Good to know" %}
18+
You can optionally include the `$id` column to define custom document IDs. If not provided, Appwrite will generate unique IDs for each document automatically.
19+
{% /info %}
20+
For example, if your collection has the following required attributes:
21+
22+
- `title` (string)
23+
- `author` (string)
24+
- `year` (integer)
25+
- `available` (boolean)
26+
27+
A valid CSV file might look like:
28+
29+
```text
30+
$id,title,author,year,available
31+
f3k91x8b2q,Harry Potter and the Sorcerer's Stone,J.K. Rowling,1997,true
32+
mz7lq3dp5c,The Fellowship of the Ring,J.R.R. Tolkien,1954,true
33+
x0v4p8ncq2,To Kill a Mockingbird,Harper Lee,1960,false
34+
```
35+
36+
{% info title="Note" %}
37+
All required attributes must be present in the CSV. Each row is validated before being imported.
38+
{% /info %}
39+
40+
41+
# Import documents from the Console {% #import-console %}
42+
43+
To import documents using the Appwrite Console:
44+
45+
1. Go to your project -> Databases
46+
2. Navigate to your target Collection
47+
3. Click on the **Import CSV** button in the action area
48+
4. Upload a new CSV file or choose an existing file from your Storage bucket
49+
50+
{% only_dark %}
51+
![CSV import screen](/images/docs/databases/dark/csv-import.png)
52+
{% /only_dark %}
53+
{% only_light %}
54+
![CSV import screen](/images/docs/databases/csv-import.png)
55+
{% /only_light %}
56+
57+
CSV imports run as background tasks. The Console displays a floating progress bar while the import is active.
58+
59+
# Additional resources {% #additional-resources %}
60+
61+
- [Appwrite CLI for Migrations](/docs/command-line-tools)
62+
- [Database Permissions](/docs/products/databases/permissions)
63+
- [Documents API Reference](/docs/references/cloud/client-web/databases)

src/routes/docs/products/databases/documents/+page.markdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ import { Client, Databases, Query } from "appwrite";
149149

150150
const client = new Client()
151151
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
152-
.setProject("<PROJECT_ID>")
152+
.setProject("<PROJECT_ID>");
153153

154154
const databases = new Databases(client);
155155

163 KB
Loading
799 KB
Loading
795 KB
Loading
799 KB
Loading

0 commit comments

Comments
 (0)