- 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
10 lines
No EOL
451 B
SQL
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(); |