| name | using-sqlfu |
| description | Use when working in a project that uses sqlfu: a SQL-first toolkit with `sqlfu.config.ts`, `definitions.sql`, migrations, checked-in query files, generated TypeScript wrappers, and commands such as `sqlfu draft`, `sqlfu migrate`, `sqlfu generate`, `sqlfu check`, or `sqlfu goto`. |
Using sqlfu
sqlfu is a SQL-first data toolkit. If this skill triggered, treat the current project/package as using sqlfu for its database workflow: SQL is the authored source and TypeScript is generated from it.
First read the config
Find the nearest sqlfu.config.ts for the project/package you are changing. It tells you where sqlfu's files live:
definitions: desired schema SQL.
migrations: ordered migration history, if the project uses migrations.
queries: checked-in .sql query files.
db: the database used by migrate, check, sync, goto, baseline, and the UI, if configured.
generate: typegen options such as schema authority, runtime validators, sync wrappers, and import extension.
Paths are relative to the config file. Do not assume the defaults if the config says otherwise.
Source files
- Edit
definitions.sql or the configured definitions file when changing the desired schema.
- Do not hand-author a new migration file. Run
sqlfu draft, then review and edit the drafted SQL if needed.
- Edit query
.sql files under the configured queries directory. Generated wrappers live under <queries>/.generated/; do not edit them directly.