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

3.5.0 • Public • Published

@nativescript-community/sqlite

Downloads per month NPM Version

SQLite for Nativescript


Table of Contents

Installation

Run the following command from the root of your project:

ns plugin add @nativescript-community/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-community/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]
        )
    );
});

Platforms sqlite versions

Package Sidebar

Install

npm i @nativescript-community/sqlite

Weekly Downloads

849

Version

3.5.0

License

Apache-2.0

Unpacked Size

121 kB

Total Files

42

Last publish

Collaborators

  • dgmachado
  • classicoldsong
  • mayerlench
  • jcassidyav
  • sebjean
  • cjohn001
  • edusperoni
  • asharghi
  • farfromrefuge
  • triniwiz
  • eddyverbruggen
  • rigor789
  • walkerrunpdx
  • dnr
  • keerl
  • cvietor
  • bradmartin
  • rdlabo
  • tralves