Waddler <> Bun SQLite
This guide assumes familiarity with:
- Database connection basics with Waddler
- Bun - website
- Bun SQLite driver - docs
According to the official website, Bun is a fast all-in-one JavaScript runtime.
Waddler natively supports bun:sqlite
module and itβs crazy fast π
We embrace SQL dialects and dialect specific drivers and syntax and mirror
SQLite-like all
, run
query methods syntax.
Step 1 - Install packages
npm
yarn
pnpm
bun
npm i waddler
Step 2 - Initialize the driver and make a query
import { waddler } from 'waddler/bun-sqlite';
const sql = waddler();
const result = await sql`select 1;`.all();
If you need to provide your existing driver:
import { waddler } from 'waddler/bun-sqlite';
import { Database } from 'bun:sqlite';
const sqlite = new Database('sqlite.db');
const sql = waddler({ client: sqlite });
const result = await sql`select 1;`.all();