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
144 Stars 16 Forks MIT License 115 Commits 4 Opened issues

Description

Deno SQLite module

Services available

!
?

Need anything else?

Contributors list

# 288,260
mit-lic...
Markdow...
markdow...
TypeScr...
98 commits
# 15,092
IPFS
schema-...
tutoria...
HTML
5 commits
# 237,021
micropa...
React
Electro...
mysql-c...
3 commits
# 16,597
TypeScr...
Deno
Rust
wasm
2 commits
# 303,172
HTML
starter...
Django
C
1 commit
# 193,000
Deno
ssl
sso
sqlite3
1 commit

Deno SQLite Module

test status docs status deno doc

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

Documentation is available as a website, on Deno Docs, or in the

docs
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 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 denosqliteplugin.

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
  • Easy: takes full advantage of Denos module cache and does not require any network access after initial download

Disadvantages

  • Speed: file system IO through Deno can be significantly lower compared to what is achievable using a native binary
  • Weaker Persistence Guarantees: due to limitations in Denos file system APIs, SQLite can't acquire file locks or memory map files, which makes some persistence guarantees less strong (e.g. this module can't safely use WAL mode)

Users

(In alphabetical order) - cotton - deno-nessie - denodb - denolib/typeorm - dexecutor

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.