Persistence
Errors
Since v1.0.0 Source
Signature
declare class PersistenceBackingError extends any { constructor(); message: any; static make(method: string, cause: unknown): PersistenceBackingError;}PersistenceError
type Since v1.0.0 Source
Signature
type PersistenceError = PersistenceParseError | PersistenceBackingError Since v1.0.0 Source
Signature
declare class PersistenceParseError extends any { constructor(); message: any; static make(method: string, error: ParseError): PersistenceParseError;}Layers
Since v1.0.0 Source
Signature
declare const layerKeyValueStore: Layer.Layer<BackingPersistence, never, KeyValueStore.KeyValueStore> Since v1.0.0 Source
Signature
declare const layerMemory: Layer.Layer<BackingPersistence> Since v1.0.0 Source
Signature
declare const layerResult: Layer<unknown, unknown, unknown> Since v1.0.0 Source
Signature
declare const layerResultKeyValueStore: Layer.Layer<ResultPersistence, never, KeyValueStore.KeyValueStore> Since v1.0.0 Source
Signature
declare const layerResultMemory: Layer.Layer<ResultPersistence>Models
BackingPersistence
interface Since v1.0.0 Source
Signature
interface BackingPersistence { readonly [BackingPersistenceTypeId]: typeof BackingPersistenceTypeId; readonly make: (storeId: string) => Effect<BackingPersistenceStore, never, Scope>;}BackingPersistenceStore
interface Since v1.0.0 Source
Signature
interface BackingPersistenceStore { readonly clear: Effect<void, PersistenceError>; readonly get: (key: string) => Effect<Option<unknown>, PersistenceError>; readonly getMany: (key: Array<string>) => Effect<Array<Option<unknown>>, PersistenceError>; readonly remove: (key: string) => Effect<void, PersistenceError>; readonly set: (key: string, value: unknown, ttl: Option<Duration>) => Effect<void, PersistenceError>; readonly setMany: (entries: readonly Array<readonly [string, unknown, Option<Duration>]>) => Effect<void, PersistenceError>;}Persistable
interface Since v1.0.0 Source
Signature
interface Persistable<A extends Schema.Schema.Any, E extends Schema.Schema.All> extends WithResult<A["Type"], A["Encoded"], E["Type"], E["Encoded"], A["Context"] | E["Context"]>, PrimaryKey {} Since v1.0.0 Source
ResultPersistence
interface Since v1.0.0 Source
Signature
interface ResultPersistence { readonly [ResultPersistenceTypeId]: typeof ResultPersistenceTypeId; readonly make: (options: { readonly storeId: string; readonly timeToLive?: (key: KeyAny, exit: Exit<unknown, unknown>) => DurationInput; }) => Effect<ResultPersistenceStore, never, Scope>;}ResultPersistenceStore
interface Since v1.0.0 Source
Signature
interface ResultPersistenceStore { readonly clear: Effect<void, PersistenceError>; readonly get: <R, IE, E, IA, A>(key: Key<R, IE, E, IA, A>) => Effect<Option<Exit<A, E>>, PersistenceError, R>; readonly getMany: <R, IE, E, IA, A>(key: readonly Array<Key<R, IE, E, IA, A>>) => Effect<Array<Option<Exit<A, E>>>, PersistenceError, R>; readonly remove: <R, IE, E, IA, A>(key: Key<R, IE, E, IA, A>) => Effect<void, PersistenceError>; readonly set: <R, IE, E, IA, A>(key: Key<R, IE, E, IA, A>, value: Exit<A, E>) => Effect<void, PersistenceError, R>; readonly setMany: <R, IE, E, IA, A>(entries: Iterable<readonly [Key<R, IE, E, IA, A>, Exit<A, E>]>) => Effect<void, PersistenceError, R>;}Other
Since v1.0.0 Source
Signature
declare function unsafeTtlToExpires(clock: Clock, ttl: Option<Duration>): number | nullType Ids
Since v1.0.0 Source
Signature
declare const BackingPersistenceTypeId: unique symbol Since v1.0.0 Source
Signature
type BackingPersistenceTypeId = typeof BackingPersistenceTypeId Since v1.0.0 Source
Signature
declare const ErrorTypeId: unique symbolErrorTypeId
type Since v1.0.0 Source
Signature
type ErrorTypeId = typeof ErrorTypeId Since v1.0.0 Source
Signature
declare const ResultPersistenceTypeId: unique symbol Since v1.0.0 Source
Signature
type ResultPersistenceTypeId = typeof ResultPersistenceTypeId