mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-15 00:17:27 +00:00
fix(skills): add missing AS alias for COALESCE in embedding search query (#896)
SearchByEmbedding query uses COALESCE(description, '') without an AS alias, causing PostgreSQL to name the column 'coalesce'. The sqlx scan struct expects db:"description", so the scan fails with: missing destination name coalesce in *[]pg.skillEmbeddingSearchRow The BackfillEmbeddings query on line 84 already has the correct AS description alias — this fix makes the search query consistent. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
60ca45ec97
commit
a8c01dbc49
1 file changed
+1
-1
@@ -29,7 +29,7 @@ func (s *PGSkillStore) SearchByEmbedding(ctx context.Context, embedding []float3
|
||||
tenantCond := buildSkillEmbeddingTenantCond(tc)
|
||||
orderN := nextParam
|
||||
limitN := orderN + 1
|
||||
q := fmt.Sprintf(`SELECT name, slug, COALESCE(description, ''), version, file_path,
|
||||
q := fmt.Sprintf(`SELECT name, slug, COALESCE(description, '') AS description, version, file_path,
|
||||
1 - (embedding <=> $1::vector) AS score
|
||||
FROM skills
|
||||
WHERE status = 'active' AND enabled = true AND embedding IS NOT NULL
|
||||
|
||||
Reference in new issue
Block a user