| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 40c984d commit 987a023
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -426,7 +426,7 @@ added: v22.5.0 | |||
| 426 | 426 | Compiles a SQL statement into a [prepared statement][]. This method is a wrapper | |
| 427 | 427 | around [`sqlite3_prepare_v2()`][]. | |
| 428 | 428 | ||
| 429 | - ### `database.createSQLTagStore([maxSize])` | ||
| 429 | + ### `database.createTagStore([maxSize])` | ||
| 430 | 430 | ||
| 431 | 431 | <!-- YAML | |
| 432 | 432 | added: v24.9.0 | |
@@ -450,7 +450,7 @@ avoid the overhead of repeatedly parsing and preparing the same SQL statements. | |||
| 450 | 450 | import { DatabaseSync } from 'node:sqlite'; | |
| 451 | 451 | ||
| 452 | 452 | const db = new DatabaseSync(':memory:'); | |
| 453 | - const sql = db.createSQLTagStore(); | ||
| 453 | + const sql = db.createTagStore(); | ||
| 454 | 454 | ||
| 455 | 455 | db.exec('CREATE TABLE users (id INT, name TEXT)'); | |
| 456 | 456 | ||
@@ -625,14 +625,14 @@ added: v24.9.0 | |||
| 625 | 625 | This class represents a single LRU (Least Recently Used) cache for storing | |
| 626 | 626 | prepared statements. | |
| 627 | 627 | ||
| 628 | - Instances of this class are created via the database.createSQLTagStore() method, | ||
| 628 | + Instances of this class are created via the database.createTagStore() method, | ||
| 629 | 629 | not by using a constructor. The store caches prepared statements based on the | |
| 630 | 630 | provided SQL query string. When the same query is seen again, the store | |
| 631 | 631 | retrieves the cached statement and safely applies the new values through | |
| 632 | 632 | parameter binding, thereby preventing attacks like SQL injection. | |
| 633 | 633 | ||
| 634 | 634 | The cache has a maxSize that defaults to 1000 statements, but a custom size can | |
| 635 | - be provided (e.g., database.createSQLTagStore(100)). All APIs exposed by this | ||
| 635 | + be provided (e.g., database.createTagStore(100)). All APIs exposed by this | ||
| 636 | 636 | class execute synchronously. | |
| 637 | 637 | ||
| 638 | 638 | ### `sqlTagStore.all(sqlTemplate[, ...values])` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments