std/db

This is the interface to the new scoped databases: a database for every val. Import this into your vals to interact with SQLite databases. This configures and re-exports an instance of the @libsql/client module, so all of the same methods work here: execute, batch and others.

Example

import sqlite from "https://esm.town/v/std/db/main.ts"; await sqlite.execute('CREATE TABLE IF NOT EXISTS "docs" (contents TEXT)'); await sqlite.execute('INSERT INTO docs (contents) VALUES ("Hello, world!")');

Looking for the interface to user databases, the legacy system: check out sqlite2.