(mode, dims, param = '$1')
| 67 | // stored column and the query param are cast to halfvec(dims) so the operator |
| 68 | // matches the halfvec HNSW index. |
| 69 | export function vectorDistanceExpr(mode, dims, param = '$1') { |
| 70 | if (mode === 'halfvec') { |
| 71 | return `(vector::halfvec(${dims})) <=> ${param}::halfvec(${dims})`; |
| 72 | } |
| 73 | return `vector <=> ${param}::vector`; |
| 74 | } |
| 75 | |
| 76 | // Startup dims-guard decision: does the existing vector column's declared |
| 77 | // dimension conflict with the provider's dims? atttypmod is the declared N for |
no outgoing calls
no test coverage detected