Package Exports
- @libsql/client
- @libsql/client/hrana
- @libsql/client/http
- @libsql/client/sqlite3
- @libsql/client/web
Readme
libSQL client API for TypeScript and JavaScript
Getting Started
To get started, you need sqld
running somewhere. Then:
import { createClient } from "@libsql/client"
const config = {
url: "ws://localhost:8080"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);
You can also connect to a local SQLite database with:
import { createClient } from "@libsql/client"
const config = {
url: "file:/tmp/example.db"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);
Features
- Connect to
sqld
(with HTTP or WebSockets) - Connect to a local SQLite database