Data in and out
With a subscription, a database can hold up to ten gigabytes, the platform’s limit, and PerSQL sets no lower limit; during the free week, Limits gives the size. Every import, export and backup runs as a job: in the background, in chunks, and you follow its progress by polling it (the web app shows a progress bar, the CLI a line). A job is queued, then running, then done, or failed with a sentence that says why.
Import
Section titled “Import”A file is uploaded in parts of 16 MiB (the upload routes, or persql import), then an import job reads it in ranges of 16 MiB, so a file of several gigabytes is never held in memory. The formats:
- CSV and TSV — the first row names the columns; types are inferred from the first thousand rows (integer, real, text). One table per file, named after the file.
- Excel — the first sheet, as a CSV would be.
- A SQL file — run as written, so it can carry many tables. PerSQL’s own exports and backups are SQL files.
- A SQLite file — every table copied in.
- A zip — each file inside handled as above.
The job’s result names each table made with its row count, and each file skipped with the reason.
Export
Section titled “Export”An export reads the table in rowid order and uploads parts of 16 MiB, so it has no size limit either. sql is the whole database as SQL statements; csv is one table. sqlite writes a SQLite database file, which is built in memory and so is limited to 69 MiB. Export a larger database as SQL, which holds the same data, and run sqlite3 new.db < export.sql to make the file.
Backups
Section titled “Backups”There are two kinds of backup, and the list shows the kind of each:
- A point in time is taken automatically before a statement that is hard to undo: an
UPDATE,DELETE,ALTER,DROPor an insert that overwrites, whether the assistant proposed it, a grid edit produced it or you sent it. One backup covers every such statement within 10 minutes, so a series of edits does not push earlier backups out. It uses SQLite’s own point-in-time recovery, so no data is copied and it is instant at any size, and it can be restored for 30 days. - A file is a SQL file you make yourself (
POST /databases/:id/backups,persql backup, or Backups in the web app). It can be downloaded and restored, and it is kept until you delete it.
A restore backs up the current state first, so a restore can be undone.