You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@testjg/nativescript-sqlite

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testjg/nativescript-sqlite

Add a plugin description

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
3
-40%
Maintainers
1
Weekly downloads
 
Created
Source

@testjg/nativescript-sqlite

Installation

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

License

Apache License Version 2.0

Keywords

NativeScript

FAQs

Package last updated on 03 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts