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
Errors from SQLite have a name
SQLiteError. - class Statement
A prepared statement.
Interfaces 2
- interface Changes
An object representing the changes made to the database since the last
runorexeccall. - interface DatabaseOptions
Options for Database
Types 1
Variables 1
- const native
The native module implementing the sqlite3 C bindings
Namespaces 1
- namespace constants
Constants from
sqlite3.h