(dbPath: string)
| 77 | } |
| 78 | |
| 79 | function 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 | |
| 111 | function writeRuntimeConfig(root: string, document: Record<string, unknown>): void { |
| 112 | const configPath = path.join(root, "state", "runtime-config.json"); |
no test coverage detected