Queries for the runtime
Use the table-bound query builder for converted values, or drop to raw SQL for joins and cases the builder does not cover.
The builder returns values with their declared types. Raw `db.all`, `db.get`, `db.run` and `db.values` return the underlying rows without mode conversion - booleans are 0/1, JSON is text, timestamps are numbers - which is useful for joins and dangerous to forget.
`db.values` is the escape hatch for same-named joined columns. The rule is simple: use the builder by default, and reach for raw SQL when the query genuinely needs it.
Typed builder
Converted values for the common read and write paths.
Raw escape hatch
Full SQL when a join or shape needs it.
Predictable values
Know exactly when conversion happens and when it does not.
Explore more
Describe your next change.
The agent plans, writes, validates, and deploys it to Telegram.