refatored rust sql and drizzle

This commit is contained in:
2025-10-22 15:05:36 +02:00
parent 9ea057e943
commit f70e924cc3
27 changed files with 3968 additions and 2747 deletions

View File

@ -21,18 +21,22 @@ export const withCrdtColumns = <
haexTimestamp: text(columnNames.haexTimestamp),
})
export const haexSettings = sqliteTable(tableNames.haex.settings.name, {
id: text()
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
key: text(),
type: text(),
value: text(),
haexTombstone: integer(tableNames.haex.settings.columns.haexTombstone, {
mode: 'boolean',
}),
haexTimestamp: text(tableNames.haex.settings.columns.haexTimestamp),
})
export const haexSettings = sqliteTable(
tableNames.haex.settings.name,
{
id: text()
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
key: text(),
type: text(),
value: text(),
haexTombstone: integer(tableNames.haex.settings.columns.haexTombstone, {
mode: 'boolean',
}),
haexTimestamp: text(tableNames.haex.settings.columns.haexTimestamp),
},
(table) => [unique().on(table.key, table.type, table.value)],
)
export type InsertHaexSettings = typeof haexSettings.$inferInsert
export type SelectHaexSettings = typeof haexSettings.$inferSelect
@ -153,7 +157,7 @@ export const haexWorkspaces = sqliteTable(
},
tableNames.haex.workspaces.columns,
),
(table) => [unique().on(table.name)],
(table) => [unique().on(table.position)],
)
export type InsertHaexWorkspaces = typeof haexWorkspaces.$inferInsert
export type SelectHaexWorkspaces = typeof haexWorkspaces.$inferSelect