跳转到内容
简体中文

MariaDbJournal

此内容尚不支持你的语言。

Defined in: src/persistence/journals/MariaDbJournal.ts:40

Journal backed by MariaDB / MySQL via the mariadb connector. Sibling of PostgresJournal (separate implementation, MariaDB dialect): ? placeholders, INSERT IGNORE for the tag dedup, ER_DUP_ENTRY (1062) as the optimistic-concurrency backstop, and LONGTEXT/BIGINT columns. Cross-process backend → no in-process event bus.

new MariaDbJournal(options?): MariaDbJournal

Defined in: src/persistence/journals/MariaDbJournal.ts:50

MariaDbJournalOptions = {}

MariaDbJournal

append<E>(pid, events, expectedSeq, tags?): Promise<PersistentEvent<E>[]>

Defined in: src/persistence/journals/MariaDbJournal.ts:59

Append events to the stream of pid, enforcing optimistic concurrency: the current highest sequence number MUST equal expectedSeq or the call throws JournalConcurrencyError. Returns the written events with their assigned sequence numbers.

E

string

readonly E[]

number

readonly string[]

Promise<PersistentEvent<E>[]>

Journal.append


close(): Promise<void>

Defined in: src/persistence/journals/MariaDbJournal.ts:172

Best-effort teardown; idempotent.

Promise<void>

Journal.close


delete(pid, toSeq): Promise<void>

Defined in: src/persistence/journals/MariaDbJournal.ts:154

Delete events up to and including toSeq — used when compacting past a snapshot.

string

number

Promise<void>

Journal.delete


highestSeq(pid): Promise<number>

Defined in: src/persistence/journals/MariaDbJournal.ts:145

Current highest sequence number for pid — 0 if no events exist.

string

Promise<number>

Journal.highestSeq


persistenceIds(): Promise<string[]>

Defined in: src/persistence/journals/MariaDbJournal.ts:166

Persistence IDs currently known to the journal (useful for projections).

Promise<string[]>

Journal.persistenceIds


read<E>(pid, fromSeq, toSeq?): Promise<PersistentEvent<E>[]>

Defined in: src/persistence/journals/MariaDbJournal.ts:121

Return events in (fromSeq, …, toSeq] order. toSeq defaults to the current highest sequence number. Inclusive bounds — fromSeq is the first event returned, not the “after” cursor.

E

string

number

number

Promise<PersistentEvent<E>[]>

Journal.read