Skip to content
This repository was archived by the owner on Apr 6, 2025. It is now read-only.

Commit 049120c

Browse files
committed
1.9.3: include only bind-parameters present in the query
1 parent 9e35aad commit 049120c

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

dist/sqlite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ Extension to use SQLite database backend for Htmx over:
7575
// use Htmx parameters as bind variables
7676
var binds = {};
7777
Object.entries(evt.detail.requestConfig.parameters).forEach(function([k,v]) {
78-
binds['$' + k] = v;
78+
// include only binds present in the query
79+
if (sql.indexOf('$' + k) > -1) {
80+
binds['$' + k] = v;
81+
}
7982
});
8083

8184
var configElem = htmx.closest(elt, '[hx-request]');

dist/sqlite.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "htmx-sqlite",
3-
"version": "1.9.2",
3+
"version": "1.9.3",
44
"description": "Htmx extension to use SQLite database backend over HTTP or OPFS",
55
"author": "Jyri-Matti Lähteenmäki <[email protected]>",
66
"keywords": [

src/sqlite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ Extension to use SQLite database backend for Htmx over:
7575
// use Htmx parameters as bind variables
7676
var binds = {};
7777
Object.entries(evt.detail.requestConfig.parameters).forEach(function([k,v]) {
78-
binds['$' + k] = v;
78+
// include only binds present in the query
79+
if (sql.indexOf('$' + k) > -1) {
80+
binds['$' + k] = v;
81+
}
7982
});
8083

8184
var configElem = htmx.closest(elt, '[hx-request]');

0 commit comments

Comments
 (0)