Need help with deno-sqlite?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

dyedgreen
239 Stars 20 Forks MIT License 189 Commits 5 Opened issues

Description

Deno SQLite module

Services available

!
?

Need anything else?

Contributors list

# 205,325
rust-li...
GraphQL
cargo
Rust
180 commits
# 13,273
IPFS
schema-...
type-in...
HTML
7 commits
# 173,035
micropa...
mysql-c...
node-js
PHP
3 commits
# 18,989
TypeScr...
Deno
Rust
remote-...
2 commits
# 288,063
HTML
starter...
Django
Deno
1 commit
# 176,695
Deno
CSS
sqlite3
Databas...
1 commit

Deno SQLite Module

test status deno doc

This is an SQLite module for JavaScript and TypeScript. The wrapper is targeted at Deno and uses a version of SQLite3 compiled to WebAssembly (WASM). This module focuses on correctness, ease of use and performance.

This module guarantees API compatibility according to semantic versioning. Please report any issues you encounter. Note that the

master
branch might contain new or breaking features. The versioning guarantee applies only to tagged releases.

Documentation

Documentation is available Deno Docs. There is also a list of examples in the

examples
folder.

Example

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();

Comparison to Plugin based Modules

TL;DR

If you want something that just works (and is fast), use this library.

Depending on your specific needs, there is also denosqliteplugin, however this module seems to no longer be actively maintained.

Advantages

  • Security: benefit from Denos security settings, without the need to trust a third party
  • Portability: runs everywhere Deno runs and can even run in the browser
  • Ease of Use: takes full advantage of Denos module cache and does not require any network access after initial download
  • Speed: thanks to WASM, the database performance is comparable to native bindings in most situations and the API is carefully designed to provide optimal performance

Disadvantages

  • Weaker Persistence Guarantees: due to limitations in Denos file system APIs, SQLite can't acquire file locks or memory map files (e.g. this module does not support WAL mode)

Users

(listed in alphabetical order, please submit a PR if you are using this library and are not included)

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.