MCPcopy
hub / github.com/aspen-cloud/triplit / EntityStore

Interface EntityStore

packages/db/src/types.ts:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48export interface EntityStore {
49 applyChanges(
50 tx: KVStoreTransaction,
51 buffer: DBChanges,
52 options: ApplyChangesOptions
53 ): Promise<DBChanges>;
54 getEntity(
55 storage: KVStoreOrTransaction,
56 collection: string,
57 id: string
58 // TODO: make this null
59 ): Promise<DBEntity | undefined>;
60 getEntitiesInCollection(
61 storage: KVStoreOrTransaction,
62 collection: CollectionName
63 ): AsyncIterable<DBEntity>;
64 getCollectionStats(
65 storage: KVStoreOrTransaction,
66 knownCollections?: CollectionName[]
67 ): Promise<Map<string, number>>;
68}
69
70export interface WriteBuffer {
71 clear(tx: KVStoreTransaction): Promise<void>;

Callers 25

handleRequestMethod · 0.65
transactMethod · 0.65
applyChangesMethod · 0.65
updateSchemaMethod · 0.65
applyChangesMethod · 0.65
applyChangesMethod · 0.65
schema.spec.tsFile · 0.65
basic.spec.tsFile · 0.65

Implementers 4

EntityStoreWithChangespackages/db/src/db-transaction.ts
EntityDataStorepackages/db/src/entity-data-store.ts
EntityStoreWithOutboxpackages/db/src/entity-store-with-outb
EntityStoreKVpackages/db/src/entity-store.ts

Calls

no outgoing calls

Tested by

no test coverage detected