mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
doc: fix sqlite tagged template examples
Signed-off-by: HoonDongKang <d159123@naver.com> PR-URL: https://github.com/nodejs/node/pull/66920 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
This commit is contained in:
1 parent
af7b97d574
commit
f69426a7c5
1 file changed
+2
-2
+2
-2
@@ -779,13 +779,13 @@ statement for future use.
|
||||
> literals, where it performs string interpolation.
|
||||
>
|
||||
> ```js
|
||||
> // This a safe example of binding a parameter to a tagged statement.
|
||||
> // This is a safe example of binding a parameter to a tagged statement.
|
||||
> sqlTagStore.run`INSERT INTO t1 (id) VALUES (${id})`;
|
||||
>
|
||||
> // This is an *unsafe* example of an untagged template string.
|
||||
> // `id` is interpolated into the query text as a string.
|
||||
> // This can lead to SQL injection and data corruption.
|
||||
> db.run(`INSERT INTO t1 (id) VALUES (${id})`);
|
||||
> db.exec(`INSERT INTO t1 (id) VALUES (${id})`);
|
||||
> ```
|
||||
|
||||
The tag store will match a statement from the cache if the query strings
|
||||
|
||||
Reference in new issue
Block a user