Mise à jour du titre (imparfait)

This commit is contained in:
fabien committed 2026-10-05 22:05:07 +02:00
1 parent 345129c7bf
commit 509a3b14c8
14 files changed
+451 -18

No files matched your search

@@ -41,6 +41,15 @@ func (r *TursoChatRepository) ListChats(userID string, teamID string, page int)
)
}
func (r *TursoChatRepository) ListChatsWithUnfreshTitles(teamID string) ([]*domain.Chat, error) {
return r.chatTable.Select(
orm.WithWhere(
"team_id=$1 and fresh_title=0",
teamID,
),
)
}
func (r *TursoChatRepository) GetChat(userID string, teamID string, id string) (*domain.Chat, error) {
return r.chatTable.SelectOne(
"id=$1 and team_id=$2 and team_id in (select team_id from user_teams where user_id=$3)",
@@ -24,7 +24,7 @@ type TursoDB struct {
func NewTursoDB(cfg *config.Config) (*TursoDB, error) {
db, err := sql.Open("turso", cfg.DatabaseURL)
if err != nil {
return nil, fmt.Errorf("error connecting to db %: %s", cfg.DatabaseURL, err)
return nil, fmt.Errorf("error connecting to db %s: %s", cfg.DatabaseURL, err)
}
return &TursoDB{
DB: db,
@@ -125,6 +125,7 @@ create table chats (
user_id text,
task_id text,
title text,
fresh_title numeric default 0,
_date_created numeric not null default current_timestamp,
_date_updated numeric,
_version text not null