Registry / database / nativescript-mtmobile-sqlite

nativescript-mtmobile-sqlite

JSON →
library1.3.0jsnpmunverified

SQLite database plugin for NativeScript applications, enabling local data storage on Android and iOS. Current version 1.3.0 is stable but shows low maintenance activity. Provides synchronous API with openOrCreate, execute, transaction, and deleteDatabase functions. Differentiates from nativescript-sqlite by offering TypeScript types and a minimal API surface, but lacks active community support and modern async patterns.

npm install nativescript-mtmobile-sqlite
INSTALL
IMPORT
SIG · NATIVESCRIPT-MTMOB
N
nativescript-mtmobile-sqlite
databasejavascriptv1.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

openOrCreate
import { openOrCreate } from 'nativescript-mtmobile-sqlite'
const openOrCreate = require('nativescript-mtmobile-sqlite').openOrCreate
ESM import preferred; CommonJS works but is less common in NativeScript TypeScript projects.
deleteDatabase
import { deleteDatabase } from 'nativescript-mtmobile-sqlite'
import deleteDatabase from 'nativescript-mtmobile-sqlite'
Named export, not default export.
SqliteDatabase
import { SqliteDatabase } from 'nativescript-mtmobile-sqlite'
Type import for TypeScript; not a runtime value.

Demonstrates openOrCreate, execute SQL statements, and deleteDatabase cleanup.

import { openOrCreate, deleteDatabase } from 'nativescript-mtmobile-sqlite'; const dbPath = 'myapp.db'; const db = openOrCreate(dbPath); try { db.execute('CREATE TABLE IF NOT EXISTS items (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT)'); db.execute('INSERT INTO items (name) VALUES (?)', ['Sample']); const result = db.execute('SELECT * FROM items'); console.log('Rows:', result); } catch (error) { console.error('SQLite error:', error); } finally { deleteDatabase(dbPath); }
Debug
Known issues
gotchaAPI is synchronous; blocking UI thread may cause jank on large queries.
fix
Wrap calls in setTimeout or use a web worker/background thread.
affects: >=1.0.0
gotchaTransaction rollback only works if cancelTransaction callback is explicitly called.
fix
Always call cancelTransaction on error to rollback, or handle in the transaction callback.
affects: >=1.0.0
brokenMethods return result objects that differ between Android and iOS (iOS returns array of arrays, Android returns array of objects).
fix
Normalize result handling per platform or use a wrapper library.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: db.execute is not a function
Incorrect import or db is null/falsy.
fix
Ensure openOrCreate returns a valid database object; check import path.
Error: no such table: [table_name]
Table not created before querying.
fix
Ensure CREATE TABLE statement is executed before SELECT/INSERT.
java.lang.IllegalStateException: attempt to re-open an already-closed object
Database closed while another operation is in progress.
fix
Use a single database instance and avoid calling deleteDatabase concurrently.
Upgrade
Version history
1.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Resources
nativescript-mtmobile-sqlite — npm install nativescript-mtmobile-sqlite · libregistry