Type Alias KyselyCacheAdapterSettings

KyselyCacheAdapterSettings: {
    enableTransactions?: boolean;
    expiredKeysRemovalInterval?: ITimeSpan;
    kysely: Kysely<KyselyCacheTables>;
    serde: ISerde<string>;
    shouldRemoveExpiredKeys?: boolean;
}

Configuration for KyselyCacheAdapter. Requires a Kysely database instance and a serde for serialising cache values to strings.

IMPORT_PATH: "@daiso-tech/core/cache/kysely-cache-adapter"

Type declaration

  • OptionalenableTransactions?: boolean
    import { Transaction } from "kysely"

    !(settings.kysely instanceof Transaction)
  • OptionalexpiredKeysRemovalInterval?: ITimeSpan

    How often expired cache entries are automatically removed in the background.

    import { TimeSpan } from "@daiso-tech/core/time-span";

    TimeSpan.fromMinutes(1)
  • kysely: Kysely<KyselyCacheTables>

    The Kysely database instance with the required cache schema tables applied.

  • serde: ISerde<string>

    Serde instance for serializing and deserializing cache values to and from strings.

  • OptionalshouldRemoveExpiredKeys?: boolean

    When true, a background task periodically removes expired keys. Set to false to disable automatic cleanup.

    true