Persistence
Errors
PersistenceBackingError
Added in v1.0.0
Source
Signature
declare class PersistenceBackingError extends any { constructor(); message: any; static make(method: string, cause: unknown): PersistenceBackingError;}PersistenceError type
Added in v1.0.0
Source
Signature
type PersistenceError = PersistenceParseError | PersistenceBackingErrorPersistenceParseError
Added in v1.0.0
Source
Signature
declare class PersistenceParseError extends any { constructor(); message: any; static make(method: string, error: ParseError): PersistenceParseError;}Layers
layerKeyValueStore
Added in v1.0.0
Source
Signature
declare const layerKeyValueStore: Layer.Layer<BackingPersistence, never, KeyValueStore.KeyValueStore>layerMemory
Added in v1.0.0
Source
Signature
declare const layerMemory: Layer.Layer<BackingPersistence>layerResult
Added in v1.0.0
Source
Signature
declare const layerResult: Layer<unknown, unknown, unknown>layerResultKeyValueStore
Added in v1.0.0
Source
Signature
declare const layerResultKeyValueStore: Layer.Layer<ResultPersistence, never, KeyValueStore.KeyValueStore>layerResultMemory
Added in v1.0.0
Source
Signature
declare const layerResultMemory: Layer.Layer<ResultPersistence>Models
BackingPersistence interface
Added in v1.0.0
Source
Signature
interface BackingPersistence { readonly [BackingPersistenceTypeId]: typeof BackingPersistenceTypeId; readonly make: (storeId: string) => Effect<BackingPersistenceStore, never, Scope>;}BackingPersistenceStore interface
Added in 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
Added in 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 {}ResultPersistence
Added in v1.0.0
Source
ResultPersistence interface
Added in 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
Added in 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
unsafeTtlToExpires
Added in v1.0.0
Source
Signature
declare function unsafeTtlToExpires(clock: Clock, ttl: Option<Duration>): number | nullType Ids
BackingPersistenceTypeId
Added in v1.0.0
Source
Signature
declare const BackingPersistenceTypeId: unique symbolBackingPersistenceTypeId type
Added in v1.0.0
Source
Signature
type BackingPersistenceTypeId = typeof BackingPersistenceTypeIdErrorTypeId
Added in v1.0.0
Source
Signature
declare const ErrorTypeId: unique symbolErrorTypeId type
Added in v1.0.0
Source
Signature
type ErrorTypeId = typeof ErrorTypeIdResultPersistenceTypeId
Added in v1.0.0
Source
Signature
declare const ResultPersistenceTypeId: unique symbolResultPersistenceTypeId type
Added in v1.0.0
Source
Signature
type ResultPersistenceTypeId = typeof ResultPersistenceTypeId