added hlc logic

This commit is contained in:
2025-07-11 13:29:34 +02:00
parent 41472e02ad
commit 0c304d7900
11 changed files with 96 additions and 394 deletions

View File

@ -6,8 +6,8 @@ export const haexCrdtMessages = sqliteTable('haex_crdt_messages', {
row_pks: text({ mode: 'json' }),
op_type: text({ enum: ['INSERT', 'UPDATE', 'DELETE'] }),
column_name: text(),
new_value: blob(),
old_value: blob(),
new_value: text({ mode: 'json' }),
old_value: text({ mode: 'json' }),
})
export type InsertHaexCrdtMessages = typeof haexCrdtMessages.$inferInsert
export type SelectHaexCrdtMessages = typeof haexCrdtMessages.$inferSelect
@ -19,3 +19,9 @@ export const haexCrdtSnapshots = sqliteTable('haex_crdt_snapshots', {
location_url: text(),
file_size_bytes: integer(),
})
export const haexCrdtSettings = sqliteTable('haex_crdt_settings', {
id: text().primaryKey(),
type: text({ enum: ['hlc_timestamp'] }).unique(),
value: text(),
})