bun.sh bindings for chDB, an embedded SQL Engine powered by ClickHouse
26
stars
43
commits
TypeScript
primary language
Mar 19, 2025
updated
Experimental chDB FFI bindings for the bun runtime
libchdb on the systemgcc or clangbun run build
bun run example.ts
import { query } from 'chdb-bun';
// Query (ephemeral)
var result = query("SELECT version()", "CSV");
console.log(result); // 23.10.1.1
import { Session } from 'chdb-bun';
const sess = new Session('./chdb-bun-tmp');
// Query Session (persistent)
sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV");
var result = sess.query("SELECT hello()", "CSV");
console.log(result);
// Before cleanup, you can find the database files in `./chdb-bun-tmp`
sess.cleanup(); // cleanup session, this will delete the database
TypeScript
46.0%
C
28.8%
Shell
18.1%
C++
7.1%
bun.sh bindings for chDB, an embedded SQL Engine powered by ClickHouse
26
stars
43
commits
TypeScript
primary language
Mar 19, 2025
updated
Experimental chDB FFI bindings for the bun runtime
libchdb on the systemgcc or clangbun run build
bun run example.ts
import { query } from 'chdb-bun';
// Query (ephemeral)
var result = query("SELECT version()", "CSV");
console.log(result); // 23.10.1.1
import { Session } from 'chdb-bun';
const sess = new Session('./chdb-bun-tmp');
// Query Session (persistent)
sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV");
var result = sess.query("SELECT hello()", "CSV");
console.log(result);
// Before cleanup, you can find the database files in `./chdb-bun-tmp`
sess.cleanup(); // cleanup session, this will delete the database
TypeScript
46.0%
C
28.8%
Shell
18.1%
C++
7.1%