limbo/bindings/javascript
Pekka Enberg b03b06107b
Some checks are pending
Python / linux (x86_64) (push) Waiting to run
Build and push limbo-sim image / deploy (push) Waiting to run
Go Tests / test (push) Waiting to run
Java Tests / test (push) Waiting to run
Run long fuzz tests on Btree / run-long-tests (push) Waiting to run
Run long fuzz tests on Btree / simple-stress-test (push) Waiting to run
JavaScript / stable - aarch64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-apple-darwin - node@20 (push) Waiting to run
JavaScript / stable - x86_64-pc-windows-msvc - node@20 (push) Waiting to run
JavaScript / stable - x86_64-unknown-linux-gnu - node@20 (push) Waiting to run
JavaScript / Test bindings on x86_64-apple-darwin - node@20 (push) Blocked by required conditions
JavaScript / Test bindings on Linux-x64-gnu - node@20 (push) Blocked by required conditions
JavaScript / Build universal macOS binary (push) Blocked by required conditions
JavaScript / Publish (push) Blocked by required conditions
Python / configure-strategy (push) Waiting to run
Python / test (push) Blocked by required conditions
Python / lint (push) Waiting to run
Python / macos-x86_64 (x86_64) (push) Waiting to run
Python / macos-arm64 (aarch64) (push) Waiting to run
Python / sdist (push) Waiting to run
Python / Release (push) Blocked by required conditions
Rust / cargo-fmt-check (push) Waiting to run
Rust / build-native (blacksmith-4vcpu-ubuntu-2404) (push) Waiting to run
Rust / build-native (macos-latest) (push) Waiting to run
Rust / build-native (windows-latest) (push) Waiting to run
Rust / clippy (push) Waiting to run
Rust / build-wasm (push) Waiting to run
Rust / simulator (push) Waiting to run
Rust / test-limbo (push) Waiting to run
Rust / test-sqlite (push) Waiting to run
Rust Benchmarks+Nyrkiö / bench (push) Waiting to run
Rust Benchmarks+Nyrkiö / clickbench (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h-criterion (push) Waiting to run
Rust Benchmarks+Nyrkiö / tpc-h (push) Waiting to run
Rust Benchmarks+Nyrkiö / vfs-bench-compile (push) Waiting to run
Turso 0.1.3-pre.2
2025-07-16 20:08:46 +03:00
..
.yarn/releases Initial JavaScript bindings with napi-rs 2025-03-26 13:30:13 +02:00
__test__ support named bind parameters 2025-07-14 15:36:12 -04:00
docs add formatting instructions for js 2025-07-01 11:11:36 -04:00
npm Turso 0.1.3-pre.2 2025-07-16 20:08:46 +03:00
src support named bind parameters 2025-07-14 15:36:12 -04:00
.gitignore Initial JavaScript bindings with napi-rs 2025-03-26 13:30:13 +02:00
.npmignore Initial JavaScript bindings with napi-rs 2025-03-26 13:30:13 +02:00
.yarnrc.yml Initial JavaScript bindings with napi-rs 2025-03-26 13:30:13 +02:00
build.rs Initial JavaScript bindings with napi-rs 2025-03-26 13:30:13 +02:00
Cargo.toml make some errors compatible with better-sqlite3 2025-07-08 11:36:23 -04:00
index.d.ts return info object 2025-07-14 14:35:48 -04:00
index.js make some errors compatible with better-sqlite3 2025-07-08 11:36:23 -04:00
package-lock.json Turso 0.1.3-pre.2 2025-07-16 20:08:46 +03:00
package.json Turso 0.1.3-pre.2 2025-07-16 20:08:46 +03:00
README.md expose wrapper and use default import 2025-07-03 15:19:03 -04:00
sqlite-error.js make some errors compatible with better-sqlite3 2025-07-08 11:36:23 -04:00
wrapper.js throw on empty statement 2025-07-14 15:28:07 -04:00
yarn.lock bindings/javascript: Regenerate yarn.lock 2025-06-30 11:25:24 +03:00

@tursodatabase/turso

The next evolution of SQLite: A high-performance, SQLite-compatible database library for Node.js

Features

  • SQLite Compatible: Drop-in replacement for better-sqlite3 with familiar API
  • High Performance: Built with Rust for maximum speed and efficiency
  • In-Process: No network overhead, runs directly in your Node.js process
  • TypeScript Support: Full TypeScript definitions included
  • Cross-Platform: Supports Linux, macOS, and Windows
  • Transaction Support: Full ACID transactions with rollback support
  • Prepared Statements: Optimized query execution with parameter binding

Installation

npm install @tursodatabase/turso

Quick Start

In-Memory Database

import Database from '@tursodatabase/turso';

// Create an in-memory database
const db = new Database(':memory:');

// Create a table
db.exec('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)');

// Insert data
const insert = db.prepare('INSERT INTO users (name, email) VALUES (?, ?)');
insert.run('Alice', 'alice@example.com');
insert.run('Bob', 'bob@example.com');

// Query data
const users = db.prepare('SELECT * FROM users').all();
console.log(users);
// Output: [
//   { id: 1, name: 'Alice', email: 'alice@example.com' },
//   { id: 2, name: 'Bob', email: 'bob@example.com' }
// ]

File-Based Database

import Database from '@tursodatabase/turso';

// Create or open a database file
const db = new Database('my-database.db');

// Create a table
db.exec(`
  CREATE TABLE IF NOT EXISTS posts (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    title TEXT NOT NULL,
    content TEXT,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
  )
`);

// Insert a post
const insertPost = db.prepare('INSERT INTO posts (title, content) VALUES (?, ?)');
const result = insertPost.run('Hello World', 'This is my first blog post!');

console.log(`Inserted post with ID: ${result.lastInsertRowid}`);

API Reference

License

MIT

Support