0.15.9 โ€ข Published 6 months ago

@libsql/client v0.15.9

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Features

Install

npm install @libsql/client

Quickstart

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],
});

Examples

ExampleDescription
localUses libsql with a local SQLite file. Creates database, inserts data, and queries.
remoteConnects to a remote database. Requires environment variables for URL and auth token.
syncDemonstrates synchronization between local and remote databases.
batchExecutes multiple SQL statements in a single batch operation.
transactionsShows transaction usage: starting, performing operations, and committing/rolling back.
memoryUses an in-memory SQLite database for temporary storage or fast access.
vectorWorks with vector embeddings, storing and querying for similarity search.
encryptionCreates and uses an encrypted SQLite database, demonstrating setup and data operations.
ollamaSimilarity search with Ollama and Mistral.

Documentation

Visit our official documentation.

Support

Join us on Discord to get help using this SDK. Report security issues via email.

Contributors

See the contributing guide to learn how to get involved.

Contributors

@everything-registry/sub-chunk-547drizzle-pluginkysely-libsqlhoroshono-with-drizzlelibsql-kvlibsql-migratelibsql-ratelimiterlibsql-studio-guillm-web-uiluminestknex-libsql-dialectmcp-memory-libsqlmcp-tursomcp-svelte-docs@vicary/kysely-libsql@yeonjoong/pulse@yourownmailer/cli@zalastax/nolb-_lib@powerhousedao/reactor-localfuzd-nodejsdrizzle-schema-checkerdriftsqldswbx-bkndenochian-studioexpress-session-libsqlfanful-react-sdkflyweight-turso@prisma/adapter-libsql@bobdivx/mf3d@bknd/data@cherrystudio/embedjs-libsql@barakcodes/kysely-libsqlcreate-z3-appdeadropdesign.email-databasebotmate-clibknd@antl3x/toolrag@affdash/database@adaneinstein/zap-assistent@aigne/platform-helpers@aigne/sqlite@andyrmitchell/drizzle-fast-bulk-test@andyrmitchell/drizzle-robust-transaction@allends/graphene-database@alexmchan/memocache@alexmchan/memocache-store-libsql@netzo/apipw-sql-reporter@oberoncms/adapter-tursostarknextstarknet-frontendsqlstudioukvumzug-libsqltursobase@astrojs/dbmulti-agent-orchestratormusic-metadata-searchmissiv-server-nodejsouterbase-studionuxt-kyselynuxt-space-devnuxt-space-layerscout-sqlitenestjs-drizzlenext-js-eva-coreprismoorealworld-hono-drizzleshamelagofer-app@effect/sql-libsql@destacks/sql@draftauth/core@drizzle-adapter/d1@drizzle-adapter/libsql@equinox-js/libsql@eth-optimism/super-cli@featlly/drizzle-adapter@fiberplane/studio@hype/hype@iconicompany/multi-agent-orchestrator-local@heimdall-logs/db@hollowleaf/payload-db-sqlite@hexlet/job-analysis@invisal-testing/studio@iridiumcms/cms@gibme/sql@glyphyai/mastra-core@gemini-dock/server@gensx/storage@jliocsar/notiz-cli@mseep/mcp-turso@mseep/mcp-memory-libsql@raffaele-oplabs/super-cli@r1tsu/db-postgres@mainframe-api/node@mainframe-so/node@mastra/libsql
0.15.4

8 months ago

0.15.5

7 months ago

0.15.6

7 months ago

0.15.7

6 months ago

0.15.8

6 months ago

0.15.9

6 months ago

0.15.0

9 months ago

0.15.1

8 months ago

0.15.2

8 months ago

0.15.3

8 months ago

0.15.0-pre.1

1 year ago

0.15.0-pre.2

10 months ago

0.15.0-pre.3

10 months ago

0.13.0

1 year ago

0.14.0-pre.1

1 year ago

0.12.1-pre.6

1 year ago

0.12.1-pre.1

1 year ago

0.12.1-pre.2

1 year ago

0.12.0

1 year ago

0.14.0

1 year ago

0.13.0-pre.2

1 year ago

0.13.0-pre.1

1 year ago

0.11.0

1 year ago

0.9.0

1 year ago

0.7.0

1 year ago

0.10.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.6.2

1 year ago

0.8.0-pre.1

1 year ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.4

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.0

2 years ago

0.4.0-pre.10

2 years ago

0.4.0-pre.8

2 years ago

0.4.0-pre.9

2 years ago

0.4.0-pre.7

2 years ago

0.4.0-pre.6

2 years ago

0.3.5-pre.1

2 years ago

0.3.5-pre.2

2 years ago

0.3.5-pre.3

2 years ago

0.3.5-pre.4

2 years ago

0.3.5-pre.5

2 years ago

0.3.5-pre.6

2 years ago

0.3.5-pre.7

2 years ago

0.3.5-pre.8

2 years ago

0.3.5-pre.9

2 years ago

0.3.7-pre.1

2 years ago

0.3.7-pre.2

2 years ago

0.3.0

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.5-pre.10

2 years ago

0.3.5-pre.11

2 years ago

0.3.2

2 years ago

0.3.5-pre.12

2 years ago

0.3.1

2 years ago

0.3.5-pre.13

2 years ago

0.3.4

2 years ago

0.3.5-pre.14

2 years ago

0.3.3

2 years ago

0.3.5-pre.15

2 years ago

0.3.6-pre.3

2 years ago

0.3.6-pre.2

2 years ago

0.3.6-pre.1

2 years ago

0.3.3-pre.2

2 years ago

0.3.3-pre.1

2 years ago

0.3.2-pre.1

2 years ago

0.3.2-pre.0

2 years ago

0.4.0-pre.2

2 years ago

0.4.0-pre.3

2 years ago

0.4.0-pre.1

2 years ago

0.4.0-pre.4

2 years ago

0.4.0-pre.5

2 years ago

0.2.0-pre.0

3 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.2

2 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago