mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
sqlite: disable DQS misfeature by default
Double-quoted string (DQS) literals are not allowed by the SQL standard, which defines that text enclosed in double quotes is to be interpreted as an identifier only and never as a string literal. Nevertheless, for historical reasons, SQLite allows double-quoted string literals in some cases, which leads to inconsistent behavior and subtle bugs. This commit changes the behavior of the built-in Node.js API for SQLite such that the DQS misfeature is disabled by default. This is recommended by the developers of SQLite. Users can explicitly enable DQS for compatibility with legacy database schemas if necessary. PR-URL: https://github.com/nodejs/node/pull/55297 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
This commit is contained in:
1 parent
3fb7426f83
commit
09d10b50dc
4 files changed
+75
-4
No files matched your search
@@ -112,6 +112,10 @@ added: v22.5.0
|
||||
legacy database schemas. The enforcement of foreign key constraints can be
|
||||
enabled and disabled after opening the database using
|
||||
[`PRAGMA foreign_keys`][]. **Default:** `true`.
|
||||
* `enableDoubleQuotedStringLiterals` {boolean} If `true`, SQLite will accept
|
||||
[double-quoted string literals][]. This is not recommended but can be
|
||||
enabled for compatibility with legacy database schemas.
|
||||
**Default:** `false`.
|
||||
|
||||
Constructs a new `DatabaseSync` instance.
|
||||
|
||||
@@ -332,6 +336,7 @@ exception.
|
||||
[`sqlite3_sql()`]: https://www.sqlite.org/c3ref/expanded_sql.html
|
||||
[connection]: https://www.sqlite.org/c3ref/sqlite3.html
|
||||
[data types]: https://www.sqlite.org/datatype3.html
|
||||
[double-quoted string literals]: https://www.sqlite.org/quirks.html#dblquote
|
||||
[in memory]: https://www.sqlite.org/inmemorydb.html
|
||||
[parameters are bound]: https://www.sqlite.org/c3ref/bind_blob.html
|
||||
[prepared statement]: https://www.sqlite.org/c3ref/stmt.html
|
||||
Reference in new issue
Block a user