Skip to content

Database.optimize() method

Home > @direct-sqlite/core > Database > optimize

Fine tunes the database engine for high-throughput scenarios.

Signature:

optimize(mode?: 'WAL' | 'MEMORY' | 'FAST'): this;

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