Database.optimize() method
Home > @direct-sqlite/core > Database > optimize
Database.optimize() method
Section titled “Database.optimize() method”Fine tunes the database engine for high-throughput scenarios.
Signature:
optimize(mode?: 'WAL' | 'MEMORY' | 'FAST'): this;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
mode |
‘WAL’ | ‘MEMORY’ | ‘FAST’ |
(Optional) The optimization mode to apply. ‘WAL’ enables Write-Ahead Logging for better concurrency, ‘MEMORY’ disables journaling and synchronous mode for maximum speed (but no durability), and ‘FAST’ disables synchronous mode and increases cache size for faster reads/writes at the cost of durability. |
Returns:
this