deno_sqlite

Tags Doc Checks License Sponsor

Fastest & correct JavaScript bindings to SQLite3 C API, using Deno FFI.

Example

import { Database } from "https://deno.land/x/sqlite3@0.5.2/mod.ts";

const db = new Database("test.db");

const [version] = db.prepare("select sqlite_version()").get<[string]>()!;
console.log(version);

db.close();

Usage

Since this library depends on the unstable FFI API, you must pass --allow-env, --allow-ffi and --unstable flags. Without it, the module will fail to find and open SQLite3 native library.

deno run --allow-ffi --allow-env --unstable <file>
# or just
deno run -A --unstable <file>

Benchmark

image

Benchmark based on just-js/02-sqlite

See bench for benchmarks source.

Documentation

See doc.md for documentation.

Check out the complete API reference here.

Native Library

By default, this module will look for existing SQLite3 dynamic library on your path, which is sqlite3.dll on Windows, libsqlite3.so on Linux, and libsqlite3.dylib on macOS. If the library you want to use is not on path, then you can use the DENO_SQLITE_PATH environment variable. You will have to install SQLite3 separately if it's not already installed, since it is not bundled with this module.

License

Check LICENSE for details.

Copyright © 2022 DjDeveloperr