SQL
sql --db PATH.db is the app database. --db is always required. The path is a directory (connection, migrations/, seeds/), not a SQLite file.
This is not a page collection. Globs list other pages at compile time. See Collections.
Done looks like
sql --db app.db "SELECT 1"
prints { "rows": […], "columns": […] }. First use on a template bundle provisions the tenant DB, writes connection, migrates, and seeds.
Worked example
cp -r /templates/crm-app ./app
sql --db ./app/app.db "SELECT id, name FROM contacts LIMIT 3"
sql --db ./app/app.db --exec \
"INSERT INTO contacts (id, name, email) VALUES (?, ?, ?)" \
"c_demo" "Ada" "ada@example.com"
Bind with ? and trailing args. Output for --exec is { "affected": 1 }.
Workspace-only: createdb, dropdb, migrate, seed, begin / commit / rollback, reload. Published *.api.sh may query, exec, and sql transaction only.
How to: Keep app data in a database.