neutralinojs-ext-sqlite3
v0.0.1-alpha.4
Published
SQLite extension for Neutralino apps with bundled SQLite and an async Promise-based API.
Downloads
19
Maintainers
Readme
neutralinojs-ext-sqlite3
SQLite extension for Neutralino applications.
Provides local SQLite database support with an async Promise-based JavaScript API.
Bundled SQLite, no system installation required. Runs as a Neutralino extension process.
Install
npm install neutralinojs-ext-sqlite3During installation, the package copies the extension binary into the extensions/ directory and updates neutralino.config.json by adding the required extension entry.
{
"enableExtensions": true,
"extensions": [
{
"id": "sqlite3",
"command": "./extensions/sqlite3/neutralinojs-ext-sqlite3 --run"
}
]
}Usage
import * as sqlite from "neutralinojs-ext-sqlite3";
Neutralino.init();
const db = await sqlite.open({ path: "app.db" });
await db.exec(`
CREATE TABLE IF NOT EXISTS messages (
id TEXT,
content TEXT
)
`);
await db.run(
"INSERT INTO messages (id, content) VALUES (?, ?)",
["1", "Hello"]
);
const rows = await db.all("SELECT * FROM messages");
await db.close();Features
- Local SQLite database files
- Promise-based async API
- Built-in TypeScript definitions
- Bundled SQLite (no system installation required)
- SQLite extension loading support
SQLite Version
The bundled SQLite version follows the version provided by the libsqlite3-sys crate used in the current release.
Platform Support
The extension is written in Rust.
Precompiled binaries are provided (as optional dependencies) for:
- macOS (arm64)
- Linux (x64, arm64)
- Windows (x64)
If no prebuilt binary matches the current platform, the postinstall script will attempt to build the extension from source. Building from source requires Rust and Cargo to be installed.
