Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
MySQL/MariaDB drivers for Fedify
Classes
A key-value store that uses MySQL (or MariaDB) as the underlying storage.
- cas(): Promise<boolean>key: KvKey,expectedValue: unknown,newValue: unknown,options?: KvStoreSetOptions
{@inheritDoc KvStore.cas}
- delete(key: KvKey): Promise<void>
{@inheritDoc KvStore.delete}
- drop(): Promise<void>
Drops the table used by the key-value store. Does nothing if the table does not exist. Resets the initialized flag so that MysqlKvStore.initialize can recreate the table on the next call.
- get<T = unknown>(key: KvKey): Promise<T | undefined>
{@inheritDoc KvStore.get}
- initialize(): Promise<void>
Creates the table used by the key-value store if it does not already exist. Does nothing if the table already exists.
- list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>
{@inheritDoc KvStore.list}
- set(): Promise<void>key: KvKey,value: unknown,options?: KvStoreSetOptions | undefined
{@inheritDoc KvStore.set}
A message queue that uses MySQL or MariaDB as the underlying storage.
Messages are delivered via periodic polling, since MySQL and MariaDB do not
provide a LISTEN/NOTIFY equivalent.
- drop(): Promise<void>
Drops the message queue table if it exists. Resets the initialized flag so that MysqlMessageQueue.initialize can recreate the table on the next call.
- enqueue(): Promise<void>message: any,options?: MessageQueueEnqueueOptions
{@inheritDoc MessageQueue.enqueue}
- enqueueMany(): Promise<void>messages: readonly any[],options?: MessageQueueEnqueueOptions
{@inheritDoc MessageQueue.enqueueMany}
- initialize(): Promise<void>
Initializes the message queue table if it does not already exist. Concurrent calls are coalesced — only one initialization runs at a time.
- listen(): Promise<void>handler: (message: any) => void | Promise<void>,options?: MessageQueueListenOptions
{@inheritDoc MessageQueue.listen}
- nativeRetrial: boolean
MySQL/MariaDB does not provide native retry mechanisms; Fedify handles retries itself.
Interfaces
Options for the MySQL key-value store.
- expireCleanupRate: number
The probability (between 0 and 1, inclusive) that expired entries are cleaned up on each mutation. Defaults to
1(always clean up). Set to0to disable automatic expiry cleanup entirely. - initialized: boolean
Whether the table has been initialized.
falseby default. - tableName: string
The table name to use for the key-value store.
"fedify_kv"by default.
Options for the MySQL message queue.
- handlerTimeout: Temporal.Duration | Temporal.DurationLike
The maximum time to wait for a message handler to complete before the queue moves on. This is a soft timeout: when a handler exceeds the limit, the queue stops waiting and logs a timeout error, but it cannot cancel the handler itself — the handler's promise continues running in the background. In the ordered-key path the advisory lock is always released in a
finallyblock, so a timed-out handler will not permanently block the same ordering key. However, concurrent side-effects from the still-running handler may interleave with the next handler for the same key; callers should be aware of this. - initialized: boolean
Whether the table has been initialized.
falseby default. - pollInterval: Temporal.Duration | Temporal.DurationLike
The poll interval for the message queue. 1 second by default.
- tableName: string
The table name to use for the message queue.
"fedify_mq"by default.