
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@libsql/client
Advanced tools
Databases for all TypeScript and JS multi-tenant apps.
Turso ยท Docs ยท Quickstart ยท SDK Reference ยท Blog & Tutorials
npm install @libsql/client
The example below uses Embedded Replicas and syncs every minute from Turso.
import { createClient } from "@libsql/client";
export const turso = createClient({
url: "file:local.db",
syncUrl: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
syncInterval: 60000,
});
await turso.batch(
[
"CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)",
{
sql: "INSERT INTO users(name) VALUES (?)",
args: ["Iku"],
},
],
"write",
);
await turso.execute({
sql: "SELECT * FROM users WHERE id = ?",
args: [1],
});
Example | Description |
---|---|
local | Uses libsql with a local SQLite file. Creates database, inserts data, and queries. |
remote | Connects to a remote database. Requires environment variables for URL and auth token. |
sync | Demonstrates synchronization between local and remote databases. |
batch | Executes multiple SQL statements in a single batch operation. |
transactions | Shows transaction usage: starting, performing operations, and committing/rolling back. |
memory | Uses an in-memory SQLite database for temporary storage or fast access. |
vector | Works with vector embeddings, storing and querying for similarity search. |
encryption | Creates and uses an encrypted SQLite database, demonstrating setup and data operations. |
ollama | Similarity search with Ollama and Mistral. |
Visit our official documentation.
Join us on Discord to get help using this SDK. Report security issues via email.
See the contributing guide to learn how to get involved.
FAQs
libSQL driver for TypeScript and JavaScript
The npm package @libsql/client receives a total of 148,709 weekly downloads. As such, @libsql/client popularity was classified as popular.
We found that @libsql/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.ย It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.