MERGE_STORE_CAPABILITIESconstno test imports itconst MERGE_STORE_CAPABILITIES: readonly ["read", "write", "list", "stat", "delete", "cas", "batch", "rename", "history", "merge"]The capabilities of the store in memory that merges.
The store in memory that merges: a replica whose files are the view of a set of immutable version rows, so that it keeps every capability of the store in memory and one more, merge. A write is a new row that replaces the heads of its path, a delete is a tombstone, the winner among the heads is the file and the other heads are its siblings. Its revision is sha256: and the digest of the bytes, as everywhere. It is the reference every backend that merges is held to, and the model whose laws a SQL dump of such a database relies on.
import { memoryMergeStore } from "./mod.ts";
const a = memoryMergeStore({ name: "a" });
a.store.id; // "merge-memory:a"MERGE_STORE_CAPABILITIESconstno test imports itconst MERGE_STORE_CAPABILITIES: readonly ["read", "write", "list", "stat", "delete", "cas", "batch", "rename", "history", "merge"]The capabilities of the store in memory that merges.
MergeStoretypeno test imports ittype MergeStore = Store<(typeof MERGE_STORE_CAPABILITIES)[number]>;The type of the store in memory that merges.
MemoryMergeOptionstypeno test imports ittype MemoryMergeOptions = {
readonly name?: string;
readonly replica?: ReplicaId;
readonly clock?: () => number;
readonly trust?: Trust;
readonly maxDrift?: number;
readonly limits?: Limits;
};What the store is made with: its name, its replica identity, the clock in milliseconds, whom it takes changes from, how far ahead it takes an id and its limits.
Siblingtypeno test imports ittype Sibling = { readonly id: string; readonly kind: "put" | "tombstone"; readonly rev: Revision | undefined; readonly replica: ReplicaId };A sibling: a head of a path that is not the winner.
MergeReplicatypeno test imports ittype MergeReplica = {
readonly store: MergeStore;
readonly replica: ReplicaId;
/** The state as it is now: rows an… (712 characters)type MergeReplica = {
readonly store: MergeStore;
readonly replica: ReplicaId;
/** The state as it is now: rows and blobs. */
state(): MergeState;
/** The heads of a path that are not the winner. */
siblings(path: Path): readonly Sibling[];
/** The rows and blobs as one text, and the files as one text. */
stateText(): string;
viewText(): string;
/** What is wrong with the rows held, whatever way they came. */
verify(): Promise<readonly MergeFinding[]>;
/** How many deltas the replica holds back. */
pending(): number;
/** Rows put in as a SQL import puts them: with no check of ours. */
importRows(versions: readonly Version[], blobs: ReadonlyMap<string, Uint8Array>): void;
};A replica: the store, and what a test or a program reads of it that the store's interface does not give.
memoryMergeStorefunctionfunction memoryMergeStore(options?: MemoryMergeOptions): MergeReplicaA store in memory that merges.