Skip to main content

Interface: Migration

Defined in: contract.ts:149

@rasd/storage — the public entry point.

This package owns three things and nothing else: the frozen StorageAdapter contract, a reference implementation of it, and the suite that proves any other implementation matches. It deliberately has no dependency on @rasd/license — that is what makes export() available in every licence state a property of the module graph rather than a promise (docs/09 §10).

Properties

data?

optional data?: (ctx) => Promise<void>;

Defined in: contract.ts:156

Row rewrites; run chunked and resumable after the schema step.

Parameters

ParameterType
ctx{ adapter: StorageAdapter; report: (done, total) => void; }
ctx.adapterStorageAdapter
ctx.report(done, total) => void

Returns

Promise<void>


name

name: string;

Defined in: contract.ts:152


needsKeys?

optional needsKeys?: boolean;

Defined in: contract.ts:158

True when this migration needs the encryption key to be available.


schema?

optional schema?: (tx) => void | Promise<void>;

Defined in: contract.ts:154

Structural changes; run inside the adapter's upgrade transaction.

Parameters

ParameterType
txunknown

Returns

void | Promise<void>


version

version: number;

Defined in: contract.ts:151

Monotonically increasing schema version this migration produces.