Translate trait-level `&[Value]` parameters into owned, `ToSql`- compatible boxes for `tokio_postgres`. Returns one boxed parameter per input `Value`; the caller borrows them as `&[&(dyn ToSql + Sync)]` for the driver call. Unsupported value variants (objects, arrays, datetimes, etc.) return `Err` rather than silently coercing — surfacing the gap to the caller so the trait contract stays honest.
(
params: &[Value],
)
| 155 | /// `Err` rather than silently coercing — surfacing the gap to the |
| 156 | /// caller so the trait contract stays honest. |
| 157 | pub(super) fn translate_params( |
| 158 | params: &[Value], |
| 159 | ) -> NodeDbResult<Vec<Box<dyn tokio_postgres::types::ToSql + Sync + Send>>> { |
| 160 | params.iter().map(translate_value).collect() |
| 161 | } |
| 162 | |
| 163 | fn translate_value(v: &Value) -> NodeDbResult<Box<dyn tokio_postgres::types::ToSql + Sync + Send>> { |
| 164 | match v { |