You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module is compatible with [sql-template-strings](https://www.npmjs.com/package/sql-template-strings).
63
+
64
+
```js
65
+
importSQLfrom'sql-template-strings';
66
+
importsqlitefrom'sqlite';
67
+
68
+
constdb=awaitsqlite.open('./database.sqlite');
69
+
70
+
constbook='harry potter';
71
+
constauthor='J. K. Rowling';
72
+
73
+
constdata=awaitdb.all(SQL`SELECT author FROM books WHERE name =${book}AND author =${author}`);
74
+
```
75
+
60
76
### Cached DB Driver
61
77
62
78
If you want to enable the [database object cache](https://github.com/mapbox/node-sqlite3/wiki/Caching)
@@ -156,6 +172,7 @@ main();
156
172
157
173
*[Using SQLite with Node.js for Rapid Prototyping](https://medium.com/@tarkus/node-js-and-sqlite-for-rapid-prototyping-bc9cf1f26f10) on Medium.com
158
174
*[SQLite Documentation](https://www.sqlite.org/docs.html), e.g. [SQL Syntax](https://www.sqlite.org/lang.html), [Data Types](https://www.sqlite.org/datatype3.html) etc. on SQLite.org
0 commit comments