Registry / database / nativescript-akylas-sqlite

nativescript-akylas-sqlite

JSON →
library3.0.5jsnpmunverified

Provides SQLite database access for NativeScript apps on Android and iOS. Version 3.0.5 stable. It offers synchronous SQLite operations (must be wrapped in async wrappers manually) and supports CRUD, transactions, and batch execution. Key differentiators: lightweight, no native build tools required, works with NativeScript CLI plugin approach. Compared to alternatives like @nativescript/sqlite, it uses a slightly different API with openOrCreate and deleteDatabase directly. The plugin ships TypeScript types and follows NativeScript plugin conventions. No major breaking changes reported recently, but users often misuse synchronous calls in UI thread.

npm install nativescript-akylas-sqlite
INSTALL
IMPORT
SIG · NATIVESCRIPT-AKYLA
N
nativescript-akylas-sqlite
databasejavascriptv3.0.5
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-akylas-sqlite'
const { openOrCreate } = require('nativescript-akylas-sqlite')
ESM import recommended for TypeScript support.
deleteDatabase
import { deleteDatabase } from 'nativescript-akylas-sqlite'
var deleteDatabase = require('nativescript-akylas-sqlite').deleteDatabase
Use named import to avoid CommonJS pitfalls.
SqliteDatabase (type)
import { SqliteDatabase } from 'nativescript-akylas-sqlite'
import SqliteDatabase from 'nativescript-akylas-sqlite'
SqliteDatabase is a named type, not default exported.

Opens or creates a SQLite database, creates a table, inserts a row, queries data, and deletes the database file.

import { openOrCreate, deleteDatabase } from 'nativescript-akylas-sqlite'; const db = openOrCreate('myapp.db'); try { db.execute('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)'); db.execute('INSERT INTO users (name) VALUES (?)', ['Alice']); const results = db.execute('SELECT * FROM users'); console.log('Users:', JSON.stringify(results)); } finally { db.close(); } // Delete the database file deleteDatabase('myapp.db');
Debug
Known issues
gotchaSynchronous API blocks the UI thread - wrap in async/await with background thread
fix
Use setTimeout or runOnBackgroundThread to avoid blocking UI.
affects: >=3.0.0
gotchaTransaction callbacks receive cancelTransaction function; calling it rolls back all changes
fix
Pass cancelTransaction as parameter and call it to abort transaction.
affects: >=3.0.0
deprecatedThe original 'nativescript-sqlite' package is unmaintained; this fork should be used
fix
Switch to nativescript-akylas-sqlite.
affects: >=3.0.0
gotchaDatabase path must be absolute or relative to app storage; using just filename may fail
fix
Use full path like `openOrCreate('./myapp.db')` or use known directories.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'nativescript-akylas-sqlite'
Plugin not installed or platform not prepared
fix
Run `tns plugin add nativescript-akylas-sqlite` and `tns prepare`
No suitable component found for path 'nativescript-akylas-sqlite'
Typo or mismatch in import path
fix
Use exact path `nativescript-akylas-sqlite` (hyphenated)
this.sqlite.execute is not a function
Calling execute on a closed database or wrong object
fix
Check that database was opened successfully and store reference correctly.
Upgrade
Version history
3.0.5latest on npm
Audit
Dependencies
nativescript-sqliteoptionalThis plugin may be a fork or wrapper over the original nativescript-sqlite; native SQLite binding library
Agent activity
10 hits · last 30 days
node
8
Resources
nativescript-akylas-sqlite — npm install nativescript-akylas-sqlite · libregistry