sqlite: add readOnly option

Allow opening existing SQLite databases with SQLITE_OPEN_READONLY set.

PR-URL: https://github.com/nodejs/node/pull/55567
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Tobias Nießen authored and GitHub committed 2024-10-31 11:41:14 +00:00
1 parent 996708042b
commit a465b206d7
4 files changed
+59 -1

No files matched your search

+2
View File
@@ -107,6 +107,8 @@ added: v22.5.0
* `open` {boolean} If `true`, the database is opened by the constructor. When
this value is `false`, the database must be opened via the `open()` method.
**Default:** `true`.
* `readOnly` {boolean} If `true`, the database is opened in read-only mode.
If the database does not exist, opening it will fail. **Default:** `false`.
* `enableForeignKeyConstraints` {boolean} If `true`, foreign key constraints
are enabled. This is recommended but can be disabled for compatibility with
legacy database schemas. The enforcement of foreign key constraints can be