MCPcopy
hub / github.com/holaboss-ai/holaOS / seedWorkspaceDataForQuery

Function seedWorkspaceDataForQuery

runtime/api-server/src/app.test.ts:79–109  ·  view source on GitHub ↗
(dbPath: string)

Source from the content-addressed store, hash-verified

77}
78
79function seedWorkspaceDataForQuery(dbPath: string): void {
80 const db = new Database(dbPath);
81 db.pragma("journal_mode = WAL");
82 db.exec(`
83 CREATE TABLE twitter_posts (
84 id TEXT PRIMARY KEY,
85 campaign_key TEXT,
86 status TEXT NOT NULL
87 );
88 CREATE TABLE campaign_plans (
89 campaign_key TEXT PRIMARY KEY,
90 owner TEXT NOT NULL
91 );
92 `);
93 db.prepare(
94 "INSERT INTO twitter_posts (id, campaign_key, status) VALUES (?, ?, ?)",
95 ).run("p1", "launch-a", "draft");
96 db.prepare(
97 "INSERT INTO twitter_posts (id, campaign_key, status) VALUES (?, ?, ?)",
98 ).run("p2", "launch-a", "draft");
99 db.prepare(
100 "INSERT INTO twitter_posts (id, campaign_key, status) VALUES (?, ?, ?)",
101 ).run("p3", "launch-b", "published");
102 db.prepare(
103 "INSERT INTO campaign_plans (campaign_key, owner) VALUES (?, ?)",
104 ).run("launch-a", "alice");
105 db.prepare(
106 "INSERT INTO campaign_plans (campaign_key, owner) VALUES (?, ?)",
107 ).run("launch-b", "bob");
108 db.close();
109}
110
111function writeRuntimeConfig(root: string, document: Record<string, unknown>): void {
112 const configPath = path.join(root, "state", "runtime-config.json");

Callers 1

app.test.tsFile · 0.85

Calls 3

execMethod · 0.80
runMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected