@@ -138,6 +138,8 @@ await db.backup("./other-backup.db", {
138138
139139### Session-based Change Tracking
140140
141+ SQLite's session extension allows you to record changes and apply them to other databases - perfect for synchronization, replication, or undo/redo functionality. This feature is available in both ` node:sqlite ` and ` @photostructure/sqlite ` , but not in better-sqlite3.
142+
141143``` typescript
142144// Create a session to track changes
143145const session = db .createSession ({ table: " users" });
@@ -149,7 +151,7 @@ db.prepare("INSERT INTO users (name, email) VALUES (?, ?)").run(
149151 " bob@example.com" ,
150152);
151153
152- // Get the changes
154+ // Get the changes as a changeset
153155const changeset = session .changeset ();
154156session .close ();
155157
@@ -201,7 +203,7 @@ This package provides performance comparable to Node.js's built-in SQLite and be
201203
202204- ** Synchronous operations** - No async/await overhead
203205- ** Direct C library access** - Minimal JavaScript ↔ native boundary crossings
204- - ** Full SQLite features** - FTS5, JSON functions, R\* Tree indexes, math functions, session extension
206+ - ** Full SQLite features** - FTS5, JSON functions, R\* Tree indexes, math functions, session extension (including changesets)
205207
206208Performance is quite similar to node: sqlite and better-sqlite3, while significantly faster than async sqlite3 due to synchronous operations.
207209
@@ -236,7 +238,7 @@ _The official SQLite module included with Node.js 22.5.0+ (experimental)_
236238- ** Zero dependencies** — Built directly into Node.js
237239- ** Official support** — Maintained by the Node.js core team
238240- ** Clean synchronous API** — Simple, predictable blocking operations
239- - ** Full SQLite power** — FTS5, JSON functions, R\* Tree, and more
241+ - ** Full SQLite power** — FTS5, JSON functions, R\* Tree, sessions/changesets, and more
240242
241243** ⚠️ Cons:**
242244
@@ -259,13 +261,15 @@ _The most popular high-performance synchronous SQLite library_
259261- ** Blazing fast** — 2-15x faster than async alternatives
260262- ** Rock-solid stability** — Battle-tested in thousands of production apps
261263- ** Rich feature set** — User functions, aggregates, virtual tables, extensions
264+ - ** Extensive community** — Large ecosystem with many resources
262265
263266** ⚠️ Cons:**
264267
265268- ** Different API** — Not compatible with Node.js built-in SQLite
266269- ** V8-specific** — Requires separate builds for each Node.js version
267270- ** Synchronous only** — No async operations (usually a feature, not a bug)
268271- ** Migration effort** — Switching from other libraries requires code changes
272+ - ** No session support** — Doesn't expose SQLite's session/changeset functionality
269273
270274** 🎯 Best for:** High-performance applications where you want maximum speed and control over the API.
271275
@@ -306,6 +310,7 @@ _The original asynchronous SQLite binding for Node.js_
306310- ✅ ** Synchronous performance** with a clean, official API
307311- ✅ ** Node-API stability** — one build works across Node.js versions
308312- ✅ ** Zero migration path** when ` node:sqlite ` becomes stable
313+ - ✅ ** Session/changeset support** for replication and synchronization
309314
310315### Choose ** ` better-sqlite3 ` ** when you want:
311316
@@ -352,6 +357,31 @@ See [TODO.md](./TODO.md) for the complete feature list and future enhancements.
352357- 📋 Additional platform-specific optimizations
353358- 📋 Enhanced debugging and profiling tools
354359
360+ ## Security
361+
362+ This project takes security seriously and employs multiple layers of protection:
363+
364+ - ** Automated scanning** : npm audit, Snyk, OSV Scanner, CodeQL (JS/TS and C++), and TruffleHog
365+ - ** Weekly security scans** : Automated checks for new vulnerabilities
366+ - ** Rapid patching** : Security fixes are prioritized and released quickly
367+ - ** Memory safety** : Validated through ASAN, valgrind, and comprehensive testing
368+
369+ ### Running Security Scans Locally
370+
371+ ``` bash
372+ # Install security tools (OSV Scanner, better-npm-audit, etc.)
373+ npm run security:setup
374+
375+ # Run all security scans
376+ npm run security
377+
378+ # Run individual scans
379+ npm run security:audit # npm audit
380+ npm run security:osv # OSV Scanner (requires Go)
381+ ```
382+
383+ For details, see our [ Security Policy] ( ./SECURITY.md ) . To report vulnerabilities, please email security@photostructure.com .
384+
355385## License
356386
357387MIT License - see [ LICENSE] ( ./LICENSE ) for details.
0 commit comments