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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MariaDbJournal(
options?):MariaDbJournal
Defined in: src/persistence/journals/MariaDbJournal.ts:50
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”MariaDbJournal
Methods
Section titled “Methods”append()
Section titled “append()”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.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”string
events
Section titled “events”readonly E[]
expectedSeq
Section titled “expectedSeq”number
readonly string[]
Returns
Section titled “Returns”Promise<PersistentEvent<E>[]>
Implementation of
Section titled “Implementation of”close()
Section titled “close()”close():
Promise<void>
Defined in: src/persistence/journals/MariaDbJournal.ts:172
Best-effort teardown; idempotent.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”delete()
Section titled “delete()”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.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”highestSeq()
Section titled “highestSeq()”highestSeq(
pid):Promise<number>
Defined in: src/persistence/journals/MariaDbJournal.ts:145
Current highest sequence number for pid — 0 if no events exist.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<number>
Implementation of
Section titled “Implementation of”persistenceIds()
Section titled “persistenceIds()”persistenceIds():
Promise<string[]>
Defined in: src/persistence/journals/MariaDbJournal.ts:166
Persistence IDs currently known to the journal (useful for projections).
Returns
Section titled “Returns”Promise<string[]>
Implementation of
Section titled “Implementation of”read()
Section titled “read()”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.
Type Parameters
Section titled “Type Parameters”E
Parameters
Section titled “Parameters”string
fromSeq
Section titled “fromSeq”number
toSeq?
Section titled “toSeq?”number
Returns
Section titled “Returns”Promise<PersistentEvent<E>[]>