Skip to content

Export & import

PerSQL produces and accepts standard SQLite SQL dumps — the same shape as sqlite3 database.db .dump. Move data in, out, or sideways without lock-in.

In the console: Database → Overview → Data → Export SQL. The download is a single .sql file containing schema + data, wrapped in a transaction.

CLI:

Terminal window
persql db export acme/orders --out orders.sql
# or pipe to stdout:
persql db export acme/orders | gzip > orders.sql.gz

REST:

Terminal window
curl -L --cookie-jar cookies.txt \
https://api.persql.com/api/namespaces/acme/databases/orders/export \
-o orders.sql

The response is application/sql with a Content-Disposition attachment so browsers download directly.

Anyone with read access to the database can export.

In the console: Database → Overview → Data → Import SQL. Pick a .sql file (50 MB cap). Imports run inside one DO transaction — partial failures roll back.

CLI:

Terminal window
persql db import acme/orders ./orders.sql

REST:

Terminal window
curl --cookie cookies.txt \
-F "file=@orders.sql" \
https://api.persql.com/api/namespaces/acme/databases/orders/import

Imports are manage-only (namespace owner / admin) — they may overwrite existing tables.

The importer is forgiving about transaction-control directives; the following are skipped automatically because the DO already wraps the whole import in a transaction:

  • BEGIN TRANSACTION / BEGIN / COMMIT / END
  • PRAGMA foreign_keys = …
  • Output is compatible with sqlite3 shell (you can sqlite3 new.db < orders.sql).
  • Input accepts anything sqlite3 .dump produces.
  • BLOB columns survive both directions (encoded as X'…hex…').