Bun ships withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/iterate/sqlfu/llms.txt
Use this file to discover all available pages before exploring further.
bun:sqlite, a built-in SQLite module that needs no separate install. The createBunClient adapter wraps it as a SyncClient, so generated query wrappers return rows directly — no await required on each call.
Configure sqlfu
Create
sqlfu.config.ts in your project root. Set generate.sync: true so generated wrappers match the synchronous bun:sqlite driver:sqlfu.config.ts
generate.sync: true produces wrappers that accept a SyncClient and return rows directly. Without it, generated wrappers default to async and require await at each call site.Write schema and queries
Add your schema to Add a query to
definitions.sql:definitions.sql
sql/queries.sql:sql/queries.sql
Draft, migrate, and generate
Run the standard sqlfu commands:This creates the migration file, applies it to the database, and generates TypeScript wrappers into
sql/.generated/.Create the client and call your queries
Import The generated wrapper is the same wrapper you would call with
Database from bun:sqlite, open the file, wrap it with createBunClient, and call the generated wrapper:src/db.ts
node:sqlite or better-sqlite3 when generate.sync: true is set. Swap the adapter, keep the rest of the code unchanged.Sync behavior
bun:sqlite is synchronous. sqlfu preserves that — createBunClient returns a SyncClient, and every generated wrapper and client.all(...) call returns rows directly:
Read next
Adapters reference
Every adapter snippet and the full sync/async compatibility matrix.
Type generation from SQL
Params, list params, INSERT objects, and generated row types.