better-sqlite3
Advanced tools
Comparing version 0.8.1 to 0.8.2
{ | ||
"name": "better-sqlite3", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "The fastest and most carefully designed library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3", |
@@ -45,4 +45,2 @@ # better-sqlite3 | ||
### Options | ||
If `options.memory` is `true`, an in-memory database will be created, rather than a disk-bound one. Default is `false`. | ||
@@ -79,3 +77,3 @@ | ||
When the operation is complete, the callback is invoked with an `Error` or `null` as its first parameter, depending on if the operation was successful. If successful, the callback's second parameter will be a number between `0` and `1`, indicating the fraction of the WAL file that was checkpointed. For forceful checkpoints ("RESTART" mode), this number will always be `1`. | ||
When the operation is complete, the callback is invoked with an `Error` or `null` as its first parameter, depending on if the operation was successful. If successful, the callback's second parameter will be a number between `0` and `1`, indicating the fraction of the WAL file that was checkpointed. For forceful checkpoints ("RESTART" mode), this number will always be `1` unless there is no WAL file. | ||
@@ -238,10 +236,10 @@ ### .close() -> this | ||
WAL mode has a few *disadvantages* to consider: | ||
WAL mode has a *few* disadvantages to consider: | ||
- Transactions that involve ATTACHed databases are atomic for each individual database, but are not atomic across all databases as a set. | ||
- Under rare circumstances, the [WAL file](https://www.sqlite.org/wal.html) may experience "checkpoint starvation" (see below). | ||
- Some hardware/system limitations that may affect some users, [listed here](https://www.sqlite.org/wal.html). | ||
- There are some hardware/system limitations that may affect some users, [listed here](https://www.sqlite.org/wal.html). | ||
However, you trade those disadvantages for greatly improved performance in most web applications. | ||
If you want to *massively* improve write performance and you're willing to sacrifice a tiny bit of [durability](https://en.wikipedia.org/wiki/Durability_(database_systems)), you can use this: | ||
If you want to *further* improve write performance and you're willing to sacrifice a tiny bit of [durability](https://en.wikipedia.org/wiki/Durability_(database_systems)), you can use this: | ||
@@ -253,9 +251,9 @@ ```js | ||
Normally, setting `synchronous = 1` would introduce the risk of database corruption following a power loss or hard reboot. But in [WAL mode](https://www.sqlite.org/wal.html), you do not introduce this risk. | ||
Normally, setting `synchronous = 1` would introduce the risk of database corruption following a power loss or hard reboot. But in [WAL mode](https://www.sqlite.org/wal.html), you do not introduce this risk. The combination of these two PRAGMAs provides extremely fast performance. | ||
### Defending against "checkpoint starvation" | ||
### Checkpoint starvation | ||
Checkpoint starvation is when SQLite3 is unable to recycle the [WAL file](https://www.sqlite.org/wal.html) due to everlasting concurrent reads to the database. If this happens, the WAL file will grow without bound, leading to unacceptable amounts of disk usage and deteriorating performance. | ||
To prevent this, you can optionally use the [db.checkpoint()](#checkpointforce-callback---this) method to force checkpointing whenever you deem appropriate. | ||
To prevent this, you can use the [db.checkpoint()](#checkpointforce-callback---this) method to force checkpointing whenever you deem appropriate. | ||
@@ -262,0 +260,0 @@ # SQLite3 compilation options |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2611370
89
197
270