edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Add support for postgis geometry/box2d/box3d types

Open jaclarke opened this issue 1 year ago • 2 comments

Queries returning postgis types are currently unsupported:

select <ext::postgis::geometry>'POINT (1 2 3)';
edgedb error: ProtocolEncodingError: base scalar with uuid 44c901c0-d922-4894-83c8-061bd05e4840 not found

Geometry is encoded in WKB format (https://libgeos.org/specifications/wkb/), and box2d/box3d are encoded as polygon geometry. See https://github.com/edgedb/edgedb-js/pull/1113.

jaclarke avatar Nov 19 '24 16:11 jaclarke

I think that probably the right way to do this is to have edgedb-rust not actually decode the WKB, but provide it to clients as bytes. This is so that we don't need to have any dependency on geometry libraries in edgedb-rust.

Then, edgedb-cli (which has a trillion deps already) can decode the WKB.

@mmastrac thoughts?

msullivan avatar Dec 06 '24 18:12 msullivan

For now this seems reasonable -- maybe we can decode to a Wkb(Bytes) and let the caller handle it?

mmastrac avatar Dec 06 '24 20:12 mmastrac