JSPM

  • Created
  • Published
  • Downloads 204014
  • Score
    100M100P100Q164402F
  • License MIT

libSQL driver for TypeScript and JavaScript

Package Exports

  • @libsql/client
  • @libsql/client/http

Readme

libSQL client API for TypeScript and JavaScript

Node.js CI License

Getting Started

To get started, you need sqld running somewhere. Then:

import { createClient } from "@libsql/client"

const config = {
  url: "http://localhost:8080"
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);

You can also just run against local SQLite with:

import { createClient } from "@libsql/client"

const config = {
  url: "file:example.db" // Use "file::memory:" for in-memory mode.
};
const db = createClient(config);
const rs = await db.execute("SELECT * FROM users");
console.log(rs);

Features

  • SQLite JavaScript API
  • SQLite-backed local-only backend
  • SQL over HTTP with fetch()