SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
2 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%

connector_state table

Simon-Pierre Boucher committed 21 days ago (Sep 11, 2026) parent af57324

2 changed files +19 −0

added packages/db/migrations/0002_connector_state.sql +7 −0
@@ -0,0 +1,7 @@
1 +CREATE TABLE IF NOT EXISTS "connector_state" (
2 + "connector_id" text NOT NULL,
3 + "key" text NOT NULL,
4 + "value" jsonb,
5 + "updated_at" timestamp with time zone DEFAULT now() NOT NULL,
6 + CONSTRAINT "connector_state_connector_id_key_pk" PRIMARY KEY("connector_id","key")
7 +);
modified packages/db/src/schema.ts +12 −0
@@ -573,3 +573,15 @@ export const systemAlerts = pgTable("system_alerts", {
573 573 resolvedAt: ts("resolved_at"),
574 574 createdAt: createdAt(),
575 575 });
576 +
577 +/** Small key/value state per connector (cursors, seen keys, discovery snapshots). */
578 +export const connectorState = pgTable(
579 + "connector_state",
580 + {
581 + connectorId: text("connector_id").notNull(),
582 + key: text("key").notNull(),
583 + value: jsonb("value"),
584 + updatedAt: updatedAt(),
585 + },
586 + (t) => [primaryKey({ columns: [t.connectorId, t.key] })],
587 +);
576 588