seed
Initial content lives next to the config: seed/<table>.json — a JSON array of row objects, keys are column names. At startup (and when a reload rebuilds the whole site), after auto-migration, the engine looks for a seed file of every table declared in settings.json. If the file exists, its rows are written in one transaction with INSERT OR REPLACE and the file is removed — each file applies once, the next start does not read it again.
- A row whose id already exists replaces that row completely; new ids are added; rows the file does not name stay as they are; rows deleted in the admin do not come back.
- Values are typed by the column: text — string, int/id — number, bool — true/false or 0/1, real — number.
- The id column may be omitted — missing ids are assigned in file order starting from 1. A file without ids put into a filled table therefore overwrites rows 1, 2, … — give explicit ids there.
- An error in the file (bad JSON, an unknown column, a wrong type) rolls the whole file back: the table stays as it was, the file is kept, and the site does not start until the file is fixed.
- If the file cannot be removed after loading, the site does not start either — remove it by hand, otherwise the next start would load it over the table again.
- To load rows again, put a seed file back.
- Over MCP,
seed_rowsloads the same kind of JSON straight into a table, without a file and without a restart — see MCP agent.
This documentation was seeded from seed/doc_groups.json and seed/docs.json; both files were removed after the first start. The feedback table has no seed file — it starts empty and fills from the contact form.
Two rows for a notes table, saved as seed/notes.json; the first row gets id 1 automatically:
[
{ "text": "First note" },
{ "text": "Second note", "id": 7 }
]Pre-loaded uploads. The built-in media table can be seeded too: seed/media.json with rows { id, ext, size, created }, while the files themselves are placed under the media folder with the id/1000 sharding — id 7 → media/0/7.jpg. After the start they behave like real uploads: listed and deletable in the Media section, and new uploads continue numbering after them. This is how a site template ships with its pictures.