Summary
impl ToSqlParam for Geography (a sub-item of #65) is not implementable over
the current bind path: Hyper has no PostgreSQL-binary input function for the
geography type, and query_params sends every parameter as PG binary
(format code 1, hardcoded). This issue tracks adding geography query-parameter
support once a text-format bind path exists.
Evidence (probed against hyperd 0.0.25080)
Binding a geography param via query_params was tried with three candidate
binary encodings — raw stored bytes (Geography::as_bytes), WKB
(Geography::to_wkb), and the HyperBinary [u32_le len][data] form
(ToHyperBinary). All three fail identically at Bind/Execute:
ERROR: no pg binary input function available for type geography (42883)
This is not an encoding bug — Hyper simply has no binary input decoder for
geography. Because the bind path is binary-only
(hyperdb-api-core/src/client/connection.rs:517, param_formats = vec![1; n]),
there is no byte sequence that makes a geography param work today.
What DID ship for geography in #65
The Inserter path (COPY / HyperBinary, a different channel) works fine, so
#65's commit added impl IntoValue for Geography + Inserter::add_geography,
verified by a round-trip test (raw bytes in → byte-identical out). Only the
query-parameter (ToSqlParam) direction is blocked.
Path to support
Same root cause and fix as #132 (scaled Numeric params): allow per-parameter
text-format bind (format code 0) instead of the current uniform binary.
Geography has a text input function (WKT), so a text-bound geography param
($1 carrying WKT bytes, oid = geography) should parse. Requires plumbing
per-parameter format codes through start_execute_prepared / frontend::bind.
Acceptance criteria
Related
Summary
impl ToSqlParam for Geography(a sub-item of #65) is not implementable overthe current bind path: Hyper has no PostgreSQL-binary input function for the
geographytype, andquery_paramssends every parameter as PG binary(format code 1, hardcoded). This issue tracks adding geography query-parameter
support once a text-format bind path exists.
Evidence (probed against hyperd 0.0.25080)
Binding a
geographyparam viaquery_paramswas tried with three candidatebinary encodings — raw stored bytes (
Geography::as_bytes), WKB(
Geography::to_wkb), and the HyperBinary[u32_le len][data]form(
ToHyperBinary). All three fail identically at Bind/Execute:This is not an encoding bug — Hyper simply has no binary input decoder for
geography. Because the bind path is binary-only(
hyperdb-api-core/src/client/connection.rs:517,param_formats = vec![1; n]),there is no byte sequence that makes a geography param work today.
What DID ship for geography in #65
The Inserter path (COPY / HyperBinary, a different channel) works fine, so
#65's commit addedimpl IntoValue for Geography+Inserter::add_geography,verified by a round-trip test (raw bytes in → byte-identical out). Only the
query-parameter (
ToSqlParam) direction is blocked.Path to support
Same root cause and fix as #132 (scaled Numeric params): allow per-parameter
text-format bind (format code
0) instead of the current uniform binary.Geography has a text input function (WKT), so a text-bound geography param
(
$1carrying WKT bytes, oid = geography) should parse. Requires plumbingper-parameter format codes through
start_execute_prepared/frontend::bind.Acceptance criteria
Geographycan be passed toquery_paramsand used in a predicate /projection (e.g.
SELECT ST_Distance($1, g) FROM ...).Related
IntoValue for Geography; this is the remainingToSqlParamhalf.