Waddler <> Bun SQL

This guide assumes familiarity with:

According to the official website, Bun is a fast all-in-one JavaScript runtime.

Waddler natively supports bun sql module and it’s crazy fast 🚀

WARNING

In version 1.2.0, Bun has issues with executing concurrent statements, which may lead to errors if you try to run several queries simultaneously. We’ve created a github issue that you can track. Once it’s fixed, you should no longer encounter any such errors on Bun’s SQL side

Step 1 - Install packages

npm
yarn
pnpm
bun
npm i waddler

Step 2 - Initialize the driver and make a query

import 'dotenv/config';
import { waddler } from 'waddler/bun-sql';

const sql = waddler(process.env.DATABASE_URL);

const result = await sql`select 1;`;

If you need to provide your existing driver:

import 'dotenv/config';
import { waddler } from 'waddler/bun-sql';
import { SQL } from 'bun';

const client = new SQL(process.env.DATABASE_URL!);
const sql = waddler({ client });

const result = await sql`select 1;`;