Ir al contenido
Español

D1DurableStateStore

Esta página aún no está disponible en tu idioma.

Defined in: src/persistence/durable-state-stores/D1DurableStateStore.ts:19

DurableStateStore backed by Cloudflare D1.

Behaviour lives in RelationalDurableStateStore; the SQLite dialect’s revision-0 insert carries ON CONFLICT DO NOTHING, so a collision reads back as zero affected rows — which D1 reports as meta.changes = 0. Unlike the journal, durable state needs no multi-statement atomicity at all, so the transport’s lack of transactions costs it nothing.

  • RelationalDurableStateStore

new D1DurableStateStore(options?): D1DurableStateStore

Defined in: src/persistence/durable-state-stores/D1DurableStateStore.ts:20

D1DurableStateStoreOptions = {}

D1DurableStateStore

RelationalDurableStateStore.constructor

close(): Promise<void>

Defined in: src/persistence/LazyStore.ts:66

Promise<void>

RelationalDurableStateStore.close


delete(persistenceId): Promise<void>

Defined in: src/persistence/relational/RelationalDurableStateStore.ts:137

Remove the record entirely. Idempotent.

string

Promise<void>

RelationalDurableStateStore.delete


load<S>(persistenceId, _options?): Promise<Option<DurableStateRecord<S>>>

Defined in: src/persistence/relational/RelationalDurableStateStore.ts:124

Load the latest record for persistenceId, or None if none exists. options.encryption is required when client-side encryption was used at write time.

S

string

PersistenceOptions

Promise<Option<DurableStateRecord<S>>>

RelationalDurableStateStore.load


upsert<S>(persistenceId, expectedRevision, state, _options?): Promise<DurableStateRecord<S>>

Defined in: src/persistence/relational/RelationalDurableStateStore.ts:76

Upsert the state for persistenceId. expectedRevision must match the current stored revision (0 when no record exists yet). Throws DurableStateConcurrencyError on conflict. Optional options carry per-call preferences from the caller (e.g. compression / encryption set on the actor); stores that cannot honour them silently ignore the field.

S

string

number

S

PersistenceOptions

Promise<DurableStateRecord<S>>

RelationalDurableStateStore.upsert