1import * as Effect from "effect/Effect";
2import * as SqlClient from "effect/sql/SqlClient";
3
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6
7 // The latest guide per pull request, keyed by its host-level identity so every project that
8 // checks out the same repository shares one. Guides cost a model run, so a push leaves the old
9 // one in place for the page to call stale rather than deleting it.
10 yield* sql`
11 CREATE TABLE IF NOT EXISTS pull_request_review_guides (
12 host TEXT NOT NULL,
13 repository TEXT NOT NULL,
14 number INTEGER NOT NULL,
15 guide_json TEXT NOT NULL,
16 PRIMARY KEY (host, repository, number)
17 ) WITHOUT ROWID
18 `;
19});