nativescript-mtmobile-sqlite
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.0 • Public • Published

    Nativescript: MtMobile Sqlite

    Build Status npm version

    Installation

    tns plugin add nativescript-mtmobile-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 "nativescript-mtmobile-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]
            )
        );
    });

    Install

    npm i nativescript-mtmobile-sqlite

    DownloadsWeekly Downloads

    1

    Version

    1.3.0

    License

    Apache-2.0

    Unpacked Size

    236 kB

    Total Files

    23

    Last publish

    Collaborators

    • jberga