This is an SQLite module for JavaScript. The wrapper is targeted at Deno and uses a version of SQLite3 compiled to WebAssembly (WASM). This module focuses on ease of use and performance.
This module guarantees API compatibility according to semantic versioning. Please report any issues you encounter.
Documentation is available as a website, on Deno Docs, or in the docs
folder.
Also try the experimental web playground!
import { DB } from "https://deno.land/x/sqlite/mod.ts";
// Open a database
const db = new DB("test.db");
db.query("CREATE TABLE IF NOT EXISTS people (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)");
const names = ["Peter Parker", "Clark Kent", "Bruce Wayne"];
// Run a simple query
for (const name of names)
db.query("INSERT INTO people (name) VALUES (?)", [name]);
// Print out data in table
for (const [name] of db.query("SELECT name FROM people"))
console.log(name);
// Close connection
db.close();
If you just want something that works, use this library. If you need serious speed, or really need to take full advantage of SQLites persistence guarantees and want to use something like WAL, use a plugin based module like the awesome deno_sqlite_plugin.
(In alphabetical order)
Author: dyedgreen
Demo: https://dyedgreen.github.io/deno-sqlite/#/
Source Code: https://github.com/dyedgreen/deno-sqlite
#deno #nodejs #node #javascript #sqlite