feat(core): initial implementation of syncing (#17814)

This commit is contained in:
James Long 2026-03-25 10:47:40 -04:00 committed by GitHub
commit b0017bf1b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 5227 additions and 2584 deletions

View file

@ -0,0 +1,16 @@
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core"
export const EventSequenceTable = sqliteTable("event_sequence", {
aggregate_id: text().notNull().primaryKey(),
seq: integer().notNull(),
})
export const EventTable = sqliteTable("event", {
id: text().primaryKey(),
aggregate_id: text()
.notNull()
.references(() => EventSequenceTable.aggregate_id, { onDelete: "cascade" }),
seq: integer().notNull(),
type: text().notNull(),
data: text({ mode: "json" }).$type<Record<string, unknown>>().notNull(),
})