@herefishyfish/requery-sqlite
TypeScript icon, indicating that this package has built-in type declarations

3.4.2 • Public • Published

Nativescript: Requery Sqlite

npm npm

Fork of the @nativescript-community/sqlite package to use the requery SQLite implementation which supports modern android SQLite features.

Installation

npm i @herefishyfish/requery-sqlite

Usage

You should take care of wrapping sqlite calls to your preferred async option (promises, observables, async/await). And catch any exceptions thrown.

import { openOrCreate, deleteDatabase } from "@herefishyfish/requery-sqlite";

const sqlite = openOrCreate("path/to/db");
sqlite.execute("CREATE TABLE names (id INT, name TEXT)");
sqlite.transaction(cancelTransaction => {
    // Calling cancelTransaction will rollback all changes made to db
    names.forEach((name, id) =>
        sqlite.execute(
            "INSERT INTO names (id, name) VALUES (?, ?)",
            [id, name]
        )
    );
});

/@herefishyfish/requery-sqlite/

    Package Sidebar

    Install

    npm i @herefishyfish/requery-sqlite

    Weekly Downloads

    1

    Version

    3.4.2

    License

    Apache-2.0

    Unpacked Size

    87.1 kB

    Total Files

    43

    Last publish

    Collaborators

    • herefishyfish