MCPcopy Create free account
hub / github.com/Effect-TS/effect / snapshot

Method snapshot

packages/sql/sqlite-do/test/Client.test.ts:27–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 columns = new Map<string, Array<string>>()
26
27 snapshot() {
28 return {
29 tables: new Map(Array.from(this.tables, ([table, rows]) => [table, rows.map((row) => ({ ...row }))])),
30 columns: new Map(Array.from(this.columns, ([table, columns]) => [table, [...columns]]))
31 }
32 }
33
34 restore(snapshot: ReturnType<FakeSqlStorage["snapshot"]>) {
35 this.tables = snapshot.tables

Callers 1

transactionMethod · 0.45

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected