naco-api/sql/queries/UpsertStyleProfiles.sql
2025-12-02 19:33:03 +00:00

10 lines
No EOL
389 B
SQL

-- name: UpsertStyleProfile :exec
INSERT INTO user_style_profiles (user_id, platform, embedding, top_keywords, style_summary, post_count)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (user_id, platform)
DO UPDATE SET
embedding = EXCLUDED.embedding,
top_keywords = EXCLUDED.top_keywords,
style_summary = EXCLUDED.style_summary,
post_count = EXCLUDED.post_count,
updated_at = NOW();