Skip to content

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):

  1. Resolve the encryption passphrase if encryption.enabled === true.
  2. Load the cipher driver or the default better-sqlite3 peer.
  3. Create the parent directory if absent (recursive: true).
  4. Open the database file.
  5. Apply WAL hardening pragmas.
  6. Apply the cipher passphrase (PRAGMA key = ...).
  7. Load sqlite-vec (unless skipSqliteVec is set).

Parameters

ParameterType
optionsOpenConnectionOptions

Returns

Promise&lt;SqliteConnection&gt;

Stable