MCPcopy Create free account
hub / github.com/cortexkit/magic-context / makeDb

Function makeDb

packages/cli/src/commands/migrate.test.ts:22–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22function makeDb() {
23 const db = new Database(":memory:");
24 databases.push(db);
25 db.exec(`
26 CREATE TABLE session (
27 id text PRIMARY KEY,
28 title text NOT NULL,
29 directory text NOT NULL,
30 path text,
31 time_created integer NOT NULL
32 );
33 CREATE TABLE message (
34 id text PRIMARY KEY,
35 session_id text NOT NULL,
36 time_created integer NOT NULL,
37 data text NOT NULL
38 );
39 CREATE TABLE part (
40 id text PRIMARY KEY,
41 message_id text NOT NULL,
42 session_id text NOT NULL,
43 time_created integer NOT NULL,
44 data text NOT NULL
45 );
46 `);
47 return db;
48}
49
50function insertSyntheticSession(db: ReturnType<typeof makeDb>) {
51 const sessionId = "ses_test";

Callers 1

migrate.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected