Skip to content

🦆 fast duckdb bindings for bun runtime

License

Notifications You must be signed in to change notification settings

evanwashere/duckdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@evan/duckdb

fast duckdb bindings for bun runtime

Install

bun add @evan/duckdb

Features

  • 🔋 batteries included
  • 🚀 jit optimized bindings
  • 🐇 2-6x faster than node & deno

Examples

import { open } from '@evan/duckdb';

const db = open('./example.db');
// or const db = open(':memory:');

const connection = db.connect();

connection.query('select 1 as number') // -> [{ number: 1 }]

for (const row of connection.stream('select 42 as number')) {
  row // -> { number: 42 }
}

const prepared = connection.prepare('select ?::INTEGER as number, ?::VARCHAR as text');

prepared.query(1337, 'foo'); // -> [{ number: 1337, text: 'foo' }]
prepared.query(null, 'bar'); // -> [{ number: null, text: 'bar' }]

connection.close();
db.close();

License

Apache-2.0 © Evan