Skip to content

SqlEventLogServerEncrypted.ts

Stores encrypted event-log server state in SQL.

This module provides the durable Storage implementation used by EventLogServerEncrypted when entries should be stored without exposing plaintext event data to the database. It persists the server remote id, session authentication bindings, and encrypted entry tables, assigns stable sequence numbers, and streams changes. Clients remain responsible for encrypting writes and decrypting reads.

Since v4.0.0



Creates encrypted event-log server Storage backed by SQL.

Details

It persists the server remote id, session authentication bindings, and encrypted entries in dialect-specific tables, creating per-identity/store entry tables as needed.

Signature

declare const makeStorage: (options?: {
readonly entryTablePrefix?: string
readonly remoteIdTable?: string
readonly insertBatchSize?: number
}) => Effect.Effect<
EventLogServerEncrypted.Storage["Service"],
SqlError.SqlError,
SqlClient.SqlClient | EventLogEncryption.EventLogEncryption | Scope.Scope
>

Source

Since v4.0.0

Provides encrypted server Storage using the SQL-backed implementation.

Signature

declare const layerStorage: (options?: {
readonly entryTablePrefix?: string
readonly remoteIdTable?: string
readonly insertBatchSize?: number
}) => Layer.Layer<
EventLogServerEncrypted.Storage,
SqlError.SqlError,
SqlClient.SqlClient | EventLogEncryption.EventLogEncryption
>

Source

Since v4.0.0

Provides SQL-backed encrypted server Storage and supplies the default Web Crypto EventLogEncryption layer.

Signature

declare const layerStorageSubtle: (options?: {
readonly entryTablePrefix?: string
readonly remoteIdTable?: string
readonly insertBatchSize?: number
}) => Layer.Layer<EventLogServerEncrypted.Storage, SqlError.SqlError, SqlClient.SqlClient>

Source

Since v4.0.0