Skip to main content
Version: Current

SqliteConfig

@rotorsoft/act-root


@rotorsoft/act-root / act-sqlite/src / SqliteConfig

Interface: SqliteConfig

Defined in: libs/act-sqlite/src/sqlite-store.ts:36

SQLite store configuration

Propertiesโ€‹

authToken?โ€‹

optional authToken?: string

Defined in: libs/act-sqlite/src/sqlite-store.ts:63

Auth token for libSQL server connections (optional)


pii_encryption?โ€‹

optional pii_encryption?: Encryption

Defined in: libs/act-sqlite/src/sqlite-store.ts:90

Adapter-layer envelope encryption for the events.pii column. Optional โ€” when present, every non-null PII payload is encrypted before INSERT and decrypted on every read; when absent, the column is stored and read as plaintext (the framework's default behavior).

Cipher and wire format come from @rotorsoft/act-crypto: AES-256-GCM with a versioned base64-framed envelope. The TEXT column stores JSON.stringify(...)-ed values either way, so encrypted writes land as a JSON-stringified base64 string and plaintext writes as a JSON-stringified object. The read path discriminates by typeof after JSON.parse โ€” strings get decrypted, objects pass through โ€” which makes mixed-data rollouts transparent.

forget_pii semantics are unchanged: the column is set to NULL regardless of whether the prior value was plaintext or ciphertext.

Encryption at rest at the storage layer (SQLite SEE, an encrypted volume, OS-level FDE) composes orthogonally with adapter-layer encryption. See docs/docs/guides/pii-encryption-at-rest.md for the decision matrix.


urlโ€‹

url: string

Defined in: libs/act-sqlite/src/sqlite-store.ts:61

libSQL connection URL. Required โ€” there is no default.

Accepted forms:

  • file:myapp.db โ€” a local database file, relative or absolute. This is the shape an embedded deployment wants.
  • libsql://โ€ฆ / https://โ€ฆ โ€” a remote libSQL server, paired with SqliteConfig.authToken.
  • :memory: / file::memory: โ€” an in-memory database. Normalized to file::memory:?cache=shared, because libSQL hands every connection its own private database otherwise and the client does not pin statements to one connection โ€” DDL would land in a database later statements cannot see, so writes would be accepted and then silently lost. Shared cache is the only in-memory mode that round-trips, and it comes with a caveat worth knowing: it is one database per process, shared by every store pointed at it, and it outlives SqliteStore.dispose. For isolated throwaway state prefer InMemoryStore from @rotorsoft/act, or give each store its own file: path.

file::memory:?cache=private is rejected at construction โ€” it is the failure mode above, spelled out explicitly.