Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

053_PullRequestFilesViewed.ts

21 lines662 Bytes

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 // Delete unticked rows; storing the absent state would grow with every scrolled diff.
8 yield* sql`
9 CREATE TABLE IF NOT EXISTS pull_request_files_viewed (
10 provider TEXT NOT NULL,
11 host TEXT NOT NULL,
12 repository TEXT NOT NULL,
13 number INTEGER NOT NULL,
14 viewer TEXT NOT NULL,
15 path TEXT NOT NULL,
16 revision TEXT,
17 viewed_at TEXT NOT NULL,
18 PRIMARY KEY (provider, host, repository, number, viewer, path)
19 ) WITHOUT ROWID
20 `;
21});