transition to postgresql for persistence layer

This commit is contained in:
Avraham Sakal
2025-08-31 12:04:18 -04:00
parent d827412feb
commit f4e9c62e96
21 changed files with 511 additions and 213 deletions
+5 -5
View File
@@ -5,17 +5,17 @@ import type { UsersId } from './Users';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.conversations */
export type ConversationsId = number & { __brand: 'public.conversations' };
export type ConversationsId = string;
/** Represents the table public.conversations */
export default interface ConversationsTable {
id: ColumnType<ConversationsId, never, never>;
id: ColumnType<ConversationsId, ConversationsId | undefined, ConversationsId>;
title: ColumnType<string | null, string | null, string | null>;
title: ColumnType<string, string, string>;
createdAt: ColumnType<string | null, string | null, string | null>;
createdAt: ColumnType<string, string | undefined, string>;
userId: ColumnType<UsersId | null, UsersId | null, UsersId | null>;
userId: ColumnType<UsersId, UsersId, UsersId>;
}
export type Conversations = Selectable<ConversationsTable>;
+7 -8
View File
@@ -2,27 +2,26 @@
// This file is automatically generated by Kanel. Do not modify manually.
import type { FactsId } from './Facts';
import type { ConversationsId } from './Conversations';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.fact_triggers */
export type FactTriggersId = number & { __brand: 'public.fact_triggers' };
export type FactTriggersId = string;
/** Represents the table public.fact_triggers */
export default interface FactTriggersTable {
id: ColumnType<FactTriggersId, never, never>;
id: ColumnType<FactTriggersId, FactTriggersId | undefined, FactTriggersId>;
sourceFactId: ColumnType<FactsId | null, FactsId | null, FactsId | null>;
sourceFactId: ColumnType<FactsId, FactsId, FactsId>;
content: ColumnType<string | null, string | null, string | null>;
content: ColumnType<string, string, string>;
priorityMultiplier: ColumnType<number | null, number | null, number | null>;
priorityMultiplier: ColumnType<number, number | undefined, number>;
priorityMultiplierReason: ColumnType<string | null, string | null, string | null>;
scopeConversationId: ColumnType<ConversationsId | null, ConversationsId | null, ConversationsId | null>;
scopeConversationId: ColumnType<string, string, string>;
createdAt: ColumnType<string | null, string | null, string | null>;
createdAt: ColumnType<string, string | undefined, string>;
}
export type FactTriggers = Selectable<FactTriggersTable>;
+6 -6
View File
@@ -6,19 +6,19 @@ import type { MessagesId } from './Messages';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.facts */
export type FactsId = number & { __brand: 'public.facts' };
export type FactsId = string;
/** Represents the table public.facts */
export default interface FactsTable {
id: ColumnType<FactsId, never, never>;
id: ColumnType<FactsId, FactsId | undefined, FactsId>;
userId: ColumnType<UsersId | null, UsersId | null, UsersId | null>;
userId: ColumnType<UsersId, UsersId, UsersId>;
sourceMessageId: ColumnType<MessagesId | null, MessagesId | null, MessagesId | null>;
sourceMessageId: ColumnType<MessagesId, MessagesId, MessagesId>;
content: ColumnType<string | null, string | null, string | null>;
content: ColumnType<string, string, string>;
createdAt: ColumnType<string | null, string | null, string | null>;
createdAt: ColumnType<string, string | undefined, string>;
}
export type Facts = Selectable<FactsTable>;
+4 -4
View File
@@ -6,11 +6,11 @@ import type { default as Role } from './Role';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.messages */
export type MessagesId = number & { __brand: 'public.messages' };
export type MessagesId = string;
/** Represents the table public.messages */
export default interface MessagesTable {
id: ColumnType<MessagesId, never, never>;
id: ColumnType<MessagesId, MessagesId | undefined, MessagesId>;
conversationId: ColumnType<ConversationsId | null, ConversationsId | null, ConversationsId | null>;
@@ -18,9 +18,9 @@ export default interface MessagesTable {
runningSummary: ColumnType<string | null, string | null, string | null>;
created_at: ColumnType<string | null, string | null, string | null>;
createdAt: ColumnType<string | null, string | null, string | null>;
role: ColumnType<Role | null, Role | null, Role | null>;
role: ColumnType<Role, Role, Role>;
parts: ColumnType<unknown | null, unknown | null, unknown | null>;
}
+2 -2
View File
@@ -6,11 +6,11 @@ import type { MessagesId } from './Messages';
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.tools */
export type ToolsId = number & { __brand: 'public.tools' };
export type ToolsId = string;
/** Represents the table public.tools */
export default interface ToolsTable {
id: ColumnType<ToolsId, never, never>;
id: ColumnType<ToolsId, ToolsId | undefined, ToolsId>;
userId: ColumnType<UsersId | null, UsersId | null, UsersId | null>;
+2 -2
View File
@@ -4,11 +4,11 @@
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
/** Identifier type for public.users */
export type UsersId = number & { __brand: 'public.users' };
export type UsersId = string;
/** Represents the table public.users */
export default interface UsersTable {
id: ColumnType<UsersId, never, never>;
id: ColumnType<UsersId, UsersId | undefined, UsersId>;
username: ColumnType<string | null, string | null, string | null>;