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

003_CheckpointDiffBlobs.ts

22 lines641 Bytes

1import * as SqlClient from "effect/unstable/sql/SqlClient";
2import * as Effect from "effect/Effect";
3​
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6​
7 yield* sql`
8 CREATE TABLE IF NOT EXISTS checkpoint_diff_blobs (
9 thread_id TEXT NOT NULL,
10 from_turn_count INTEGER NOT NULL,
11 to_turn_count INTEGER NOT NULL,
12 diff TEXT NOT NULL,
13 created_at TEXT NOT NULL,
14 UNIQUE (thread_id, from_turn_count, to_turn_count)
15 )
16 `;
17​
18 yield* sql`
19 CREATE INDEX IF NOT EXISTS idx_checkpoint_diff_blobs_thread_to_turn
20 ON checkpoint_diff_blobs(thread_id, to_turn_count)
21 `;
22});