Skip to content
JavaScript SQLite library targeting Deno
C JavaScript TypeScript Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Closes issue #7 Jan 13, 2020
build
docs Return Sqlite status code on error (#4) Jan 15, 2020
src Return Sqlite status code on error (#4) Jan 15, 2020
.gitattributes Add docsify doc-viewer Dec 19, 2019
.gitignore
LICENSE
README.md Add test checks on PR, separate docs from tests Jan 12, 2020
bench.ts Move to WASI Dec 18, 2019
mod.ts
test.ts

README.md

JavaScript SQLite Module

test status

This is an SQLite module for JavaScript. The wrapper is targeted at Deno and uses a version of SQLite3 compiled to WebAssembly (WASM).

This is still in an early stage of development. If you use this in a project, please report any issues you encounter, as well any other feedback by opening an issue.

Documentation

Documentation is available as a website or in the docs folder.

Example

import { open, save } from "https://deno.land/x/sqlite/mod.ts";

// Open a database
const db = await open("test.db");
db.query("CREATE TABLE IF NOT EXISTS people (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)");

const name = ["Peter Parker", "Clark Kent", "Bruce Wayne"][Math.floor(Math.random() * 3)];

// Run a simple query
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);

// Save and close connection
save(db);
db.close();

TODO - Goals

  • Initial API draft
  • Tests
  • Support BLOBs
  • The WASM context seems to prevent Deno from exiting when an error is thrown (fixed by deno 3503)
  • Benchmarks
  • Documentation (there are in-file comments)
  • Replace EMSCRIPTEN with WASI
  • More tests (high-load, edge-cases, issues as they arise)
  • Documentation on general design and best practices
  • More/ better benchmarks
  • Rewrite internals to use TypeScript
You can’t perform that action at this time.