Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/store-sqlite / connection / openConnection
Function: openConnection()
ts
function openConnection(options): Promise<SqliteConnection>;Defined in: packages/store-sqlite/src/connection.ts:205
Opens a connection. Side effects (in this order):
- Resolve the encryption passphrase if
encryption.enabled === true. - Load the cipher driver or the default
better-sqlite3peer. - Create the parent directory if absent (
recursive: true). - Open the database file.
- Apply WAL hardening pragmas.
- Apply the cipher passphrase (
PRAGMA key = ...). - Load
sqlite-vec(unlessskipSqliteVecis set).
Parameters
| Parameter | Type |
|---|---|
options | OpenConnectionOptions |
Returns
Promise<SqliteConnection>