module
bun:sqlite
The 'bun:sqlite' module is a high-performance SQLite3 driver built directly into Bun. The API is simple, synchronous, and inspired by better-sqlite3, offering a clean and intuitive interface for database operations.
Key features include prepared statements, transactions, both named and positional parameters, datatype conversions (BLOB to Uint8Array), mapping query results to classes, and support for bigint. Multi-query statements can be executed in a single call to database.run().
Performance benchmarks show bun:sqlite is approximately 3-6x faster than better-sqlite3 and 8-9x faster than deno.land/x/sqlite for read queries, making it the fastest SQLite driver available for JavaScript.
Classes 3
- class Database
A SQLite3 database
- class SQLiteError
An error from SQLite.
- class Statement
A prepared statement.
Interfaces 4
- interface AggregateOptions
Options for Database.aggregate
- interface Changes
An object representing the changes made to the database since the last
runorexeccall. - interface DatabaseOptions
Options for Database
- interface FunctionOptions
Options for Database.function and Database.aggregate
Types 3
- type SQLFunctionResult
What a function defined with Database.function or
- type SQLQueryBindings
- type UpdateHook
The type of Database.onInsert, Database.onUpdate and Database.onDelete
Namespaces 1
- namespace constants
Constants from
sqlite3.h