bungibindies/bun/sqlite

Bun:sqlite module

Types

The Database type is an instance of a database collection.

pub type Database

A Statement is a prepared query, which means it’s been parsed and compiled into an efficient binary form. It can be executed multiple times in a performant way.

pub type Statement

Functions

pub fn new(to: String) -> Database

bun:sqlite.Database -> New()

  • Sqlite

Create a new database connection

pub fn prepare(db: Database, query: String) -> Statement

bun:sqlite.Statement -> prepare()

  • Sqlite

Use the db.prepare() method on your Database instance to prepare a SQL query. The result is a Statement instance that will NOT be cached on the Database instance. _The query will not be executed.

Note — Use the .query() method to prepare a query with caching it on the Database instance.

pub fn query(db: Database, query: String) -> Statement

bun:sqlite.Database -> query()

  • Sqlite

Use the db.query() method on your Database instance to prepare a SQL query. The result is a Statement instance that will be cached on the Database instance. _The query will not be executed.

Note — Use the .prepare() method to prepare a query without caching it on the Database instance.

Search Document