naco-api/sql/queries/UpsertStyleProfiles.sql
Nacorid d7bece250f Use named parameters in SQL queries to avoid ColumnN naming in sqlc generated structs
- Rewrite GetStyleProfile, FindSimilarUsers, UpsertStyleProfiles SQL queries
  to use @named parameters instead of  positional placeholders
- Regenerate sqlc Go files with meaningful parameter names
- Update server.go and integration test to use new parameter field names
- Fix Similarity int32→float64 type conversion
2026-08-30 22:41:53 +02:00

10 lines
No EOL
451 B
SQL

-- name: UpsertStyleProfile :exec
INSERT INTO user_style_profiles (user_id, platform, embedding, top_keywords, style_summary, post_count)
VALUES (@user_id, @platform, @embedding::vector, @top_keywords, @style_summary, @post_count)
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,
modified_at = NOW();