Files
turso/bindings/javascript
Glauber Costa 1679062d8c docs: drop the beta warning for 0.7
Turso runs in production at multiple organizations, so the "this
software is in BETA, use caution with production data" warning no
longer reflects reality. It appeared in the main README, was
copy-pasted in 11 bindings READMEs (what users see on npm, PyPI, and
pkg.go.dev), and was printed by tursodb at every shell startup.

- README: remove the warning blockquote from About, leaving a one-line
  status pointer. Rewrite the production-readiness FAQ to lead with
  production use and the testing story, keeping the honest caveats in
  softer form: not yet 1.0, some features experimental, keep backups
  as with any database. Add a FAQ on SQLite compatibility (gap tracked
  in COMPAT.md, closing quickly, required for 1.0), and fix the libSQL
  FAQ, which still claimed Turso Database is not production ready.
- bindings READMEs: replace the warning with the same softened status
  line, linking to the FAQ.
- cli: remove the startup banner line entirely, matching the SQLite
  shell.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:56:57 -05:00
..
2025-07-25 11:45:57 -03:00
2026-07-03 10:56:57 -05:00
2025-09-09 14:06:10 +04:00
2025-07-28 14:48:51 -03:00
2026-06-29 11:58:42 +04:00
2026-06-29 11:58:42 +04:00
2026-07-03 10:56:57 -05:00
2026-06-29 11:58:42 +04:00

Turso Database for JavaScript

npm

Chat with other users of Turso on Discord


About

This package is the Turso in-memory database library for JavaScript.

Turso Database runs in production today at multiple organizations. It has not yet reached 1.0, so as with any database we recommend keeping backups — see the FAQ for where the project stands.

Features

  • SQLite compatible: SQLite query language and file format support (status).
  • In-process: No network overhead, runs directly in your Node.js process
  • TypeScript support: Full TypeScript definitions included
  • Cross-platform: Supports Linux (x86 and arm64), macOS, Windows and browsers (through WebAssembly)

Installation

npm install @tursodatabase/database

Getting Started

In-Memory Database

import { connect } from '@tursodatabase/database';

// Create an in-memory database
const db = await connect(':memory:');

// Create a table
await 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 (?, ?)');
await insert.run('Alice', 'alice@example.com');
await insert.run('Bob', 'bob@example.com');

// Query data
const users = await 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 { connect } from '@tursodatabase/database';

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

// Create a table
await 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 = await insertPost.run('Hello World', 'This is my first blog post!');

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

Transactions

import { connect } from '@tursodatabase/database';

const db = await connect('transactions.db');

// Using transactions for atomic operations
const transaction = db.transaction(async (users) => {
  const insert = db.prepare('INSERT INTO users (name, email) VALUES (?, ?)');
  for (const user of users) {
    await insert.run(user.name, user.email);
  }
});

// Execute transaction
await transaction([
  { name: 'Alice', email: 'alice@example.com' },
  { name: 'Bob', email: 'bob@example.com' }
]);

WebAssembly Support

Turso Database can run in browsers using WebAssembly. Check the browser.js and WASM artifacts for browser usage.

API Reference

For complete API documentation, see JavaScript API Reference.

License

This project is licensed under the MIT license.

Support