Skip to main content

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score94%
License
MIT
Downloads22/wk
Publisheda day ago (2.1.2)

SQLite drivers for Fedify

Classes

c
SqliteKvStore(
db: PlatformDatabase,
options?: SqliteKvStoreOptions
)

A key–value store that uses SQLite as the underlying storage.

  • cas(
    key: KvKey,
    expectedValue: unknown,
    newValue: unknown,
    options?: KvStoreSetOptions
    ): Promise<boolean>

    {@inheritDoc KvStore.cas}

  • delete(key: KvKey): Promise<void>

    {@inheritDoc KvStore.delete}

  • drop(): void

    Drops the table used by the key–value store. Does nothing if the table does not exist.

  • get<T = unknown>(key: KvKey): Promise<T | undefined>

    {@inheritDoc KvStore.get}

  • initialize(): 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(
    key: KvKey,
    value: unknown,
    options?: KvStoreSetOptions
    ): Promise<void>

    {@inheritDoc KvStore.set}

c
SqliteMessageQueue(
db: PlatformDatabase,
options?: SqliteMessageQueueOptions
)

A message queue that uses SQLite as the underlying storage.

  • drop(): void

    Drops the tables used by the message queue. Does nothing if the tables do not exist.

  • enqueue(
    message: any,
    options?: MessageQueueEnqueueOptions
    ): Promise<void>

    {@inheritDoc MessageQueue.enqueue}

  • enqueueMany(
    messages: readonly any[],
    options?: MessageQueueEnqueueOptions
    ): Promise<void>

    {@inheritDoc MessageQueue.enqueueMany}

  • initialize(): void

    Creates the message queue table if it does not already exist. Does nothing if the table already exists.

  • listen(
    handler: (message: any) => Promise<void> | void,
    options?: MessageQueueListenOptions
    ): Promise<void>

    {@inheritDoc MessageQueue.listen}

  • nativeRetrial: boolean

    SQLite message queue does not provide native retry mechanisms.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/sqlite

Import symbol

import * as mod from "@fedify/sqlite";
or

Import directly with a jsr specifier

import * as mod from "jsr:@fedify/sqlite";