Coder Social home page Coder Social logo

aapoalas / sqlite3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from denodrivers/sqlite3

0.0 0.0 0.0 1.1 MB

The fastest and correct module for SQLite3 in Deno.

Home Page: https://deno.land/x/sqlite3

License: Apache License 2.0

Shell 0.41% JavaScript 17.81% Python 0.73% C 1.48% TypeScript 79.19% Makefile 0.38%

sqlite3's Introduction

Deno SQLite3

Tags Doc Checks License Sponsor

The fastest and correct module for SQLite3 in Deno.

Example

import { Database } from "https://deno.land/x/[email protected]/mod.ts";

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

const [version] = db.prepare("select sqlite_version()").value<[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. Network and FS permissions are also needed on macOS and Linux to download and cache prebuilt library. It's recommended to just use --allow-all/-A flag since FFI basically gives full access.

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

It will download and cache a prebuilt shared library from GitHub releases. For which it will also need net and read/write permission.

If you want to use custom library, then you can set the DENO_SQLITE_PATH environment variable, containing full path to the SQLite3 shared library.

Contributing

Code is formatted using deno fmt and linted using deno lint. Please make sure to run these commands before committing.

On Linux and macOS, you need to build sqlite3 from source. Make sure that you have the submodule (git submodule update --init --recursive).

mkdir -p build/
# unix
make
# windows
deno task build-sqlite-win

When running tests and benchmarks, you need to use the DENO_SQLITE_PATH env variable otherwise it won't use to local compiled shared library.

DENO_SQLITE_PATH=build/libsqlite3.dylib deno task bench

Related

License

Apache-2.0. Check LICENSE for details.

Copyright © 2023 DjDeveloperr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.