# tryghost/node-sqlite3

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tryghost-node-sqlite3).**

6,417 stars · 847 forks · PLpgSQL · BSD-3-Clause

## Links

- GitHub: https://github.com/TryGhost/node-sqlite3
- awesome-repositories: https://awesome-repositories.com/repository/tryghost-node-sqlite3.md

## Description

node-sqlite3 is a relational database client and a set of native bindings that allow Node.js applications to interact with SQLite databases. It functions as a C++ native addon, linking JavaScript to the SQLite C library to manage data stored in local files or in-memory stores.

The project includes optional support for SQLCipher, enabling page-level encryption to secure local database files.

The driver covers a wide range of database management capabilities, including executing SQL queries with parameter binding, managing connections to database files, and preparing statements for repeated execution. It also supports streaming query results, loading external database extensions, and monitoring query execution durations.

## Tags

### Data & Databases

- [Embedded Databases](https://awesome-repositories.com/f/data-databases/embedded-databases.md) — Implements a lightweight relational database engine that runs directly within the application process.
- [SQL Query Execution](https://awesome-repositories.com/f/data-databases/sql-query-execution.md) — Provides a native Node.js interface for running SQL queries and retrieving structured data from SQLite. ([source](https://github.com/tryghost/node-sqlite3#readme))
- [Local File Storage](https://awesome-repositories.com/f/data-databases/data-engineering-infrastructure/data-persistence-storage/data-storage/file-based-storage/local-file-storage.md) — Persists application state and user data directly to local disk storage using SQLite files.
- [Database Connection Management](https://awesome-repositories.com/f/data-databases/database-connection-management.md) — Creates and manages connections to SQLite database files or in-memory stores. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [Single Row Fetches](https://awesome-repositories.com/f/data-databases/query-result-fetching/single-row-fetches.md) — Retrieves the first matching record from a query result as a single JavaScript object. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [All-Record Retrievers](https://awesome-repositories.com/f/data-databases/record-insertion/inserted-record-retrievers/all-record-retrievers.md) — Retrieves all matching records from a query result and returns them as a complete array. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [Relational Data Stores](https://awesome-repositories.com/f/data-databases/relational-data-stores.md) — Provides a relational database client for executing SQL queries against local or in-memory stores.
- [Statement Executions](https://awesome-repositories.com/f/data-databases/sql-statement-parsing/statement-executions.md) — Executes SQL statements such as INSERT or UPDATE that modify data without returning result rows. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [SQLite3 Node.js Drivers](https://awesome-repositories.com/f/data-databases/sqlite3-extensions/sqlite3-node-js-drivers.md) — Provides native bindings to enable Node.js applications to interact with SQLite databases.
- [Query Optimization](https://awesome-repositories.com/f/data-databases/high-performance-databases/query-optimization.md) — Optimizes database interactions using prepared statements and streamed results to handle large datasets efficiently.
- [Local Database Security](https://awesome-repositories.com/f/data-databases/local-database-security.md) — Implements page-level encryption for local database files by integrating SQLCipher.
- [Prepared Statements](https://awesome-repositories.com/f/data-databases/prepared-statements.md) — Compiles a query once to be reused multiple times with different parameters for faster execution. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [Compilation Caches](https://awesome-repositories.com/f/data-databases/query-caching-strategies/compilation-caches.md) — Pre-compiles SQL strings into bytecode within the engine to reduce parsing overhead during repeated executions.
- [Result Streaming](https://awesome-repositories.com/f/data-databases/query-result-fetching/result-streaming.md) — Iterates through result rows one by one via a callback to handle large datasets without memory exhaustion. ([source](https://github.com/TryGhost/node-sqlite3/wiki/API))
- [Row-Based Result Streaming](https://awesome-repositories.com/f/data-databases/row-based-result-streaming.md) — Processes large query result sets one row at a time via an iterator to minimize memory consumption.

### Programming Languages & Runtimes

- [Node.js Database Integration](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-database-integration.md) — Connects Node.js applications to SQLite databases for structured data storage and retrieval.
- [Node.js Native Addons](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-native-addons.md) — Links JavaScript to the SQLite C library as a C++ native addon for direct memory access.

### Software Engineering & Architecture

- [Parameter Bindings](https://awesome-repositories.com/f/software-engineering-architecture/parameter-bindings.md) — Maps JavaScript types to SQLite C types to prevent SQL injection and handle binary blobs securely.

### Security & Cryptography

- [SQLCipher-Based Encryptions](https://awesome-repositories.com/f/security-cryptography/end-to-end-encryption/credential-encryption/sqlcipher-based-encryptions.md) — Integrates with SQLCipher to provide transparent page-level encryption for local database files. ([source](https://github.com/tryghost/node-sqlite3#readme))
- [Database Page Encryption](https://awesome-repositories.com/f/security-cryptography/full-disk-encryption/database-page-encryption.md) — Provides transparent page-level encryption for database files through optional SQLCipher linking.
