new Database(databasePath, bufferManagerSize, enableCompression, readOnly, autoCheckpoint, checkpointThreshold)
Initialize a new Database object. Note that the initialization is done
lazily, so the database file is not opened until the first query is
executed. To initialize the database immediately, call the `init()`
function on the returned object.
Parameters:
| Name | Type | Description |
|---|---|---|
databasePath |
String | path to the database file. If the path is not specified, or empty, or equal to `:memory:`, the database will be created in memory. |
bufferManagerSize |
Number | size of the buffer manager in bytes. |
enableCompression |
Boolean | whether to enable compression. |
readOnly |
Boolean | if true, database will be opened in read-only mode. |
autoCheckpoint |
Boolean | if true, automatic checkpointing will be enabled. |
checkpointThreshold |
Number | threshold for automatic checkpointing in bytes. Default is 16MB. |
- Source:
Methods
(async) close()
Close the database.
- Source:
(async) init()
Initialize the database. Calling this function is optional, as the
database is initialized automatically when the first query is executed.
- Source: