Problem
pgvector distance and inner-product operations return PostgreSQL DOUBLE PRECISION, but dbkit models them as f32 / Option<f32>.
Affected helpers:
l2_distance
cosine_distance
inner_product
l1_distance
inner_product_distance
Filtering and ordering can appear to work because PostgreSQL coerces thresholds. Selecting a result into the advertised Rust f32 can fail SQLx decoding because the database returns DOUBLE PRECISION.
Expected behavior
- Return
Expr<f64> when both operands are required.
- Return
Expr<Option<f64>> when either operand is nullable.
- Preserve vector dimension checking and current NULL propagation.
- Update explicit
f32 thresholds, API assertions, and documentation to f64 where they consume these scalar results.
- Add required and nullable integration projections that decode the returned scalar.
pgvector vector function result types
Problem
pgvector distance and inner-product operations return PostgreSQL
DOUBLE PRECISION, but dbkit models them asf32/Option<f32>.Affected helpers:
l2_distancecosine_distanceinner_productl1_distanceinner_product_distanceFiltering and ordering can appear to work because PostgreSQL coerces thresholds. Selecting a result into the advertised Rust
f32can fail SQLx decoding because the database returnsDOUBLE PRECISION.Expected behavior
Expr<f64>when both operands are required.Expr<Option<f64>>when either operand is nullable.f32thresholds, API assertions, and documentation tof64where they consume these scalar results.pgvector vector function result types