Closed sunny-g closed 1 year ago
I don't use diesel, but I'm a little surprised that you'd build an Ewkb from an entire row. I'd expect just a single field of the row to be the ewkb.
@myaple ?
Sorry, complete oversight on my implementation. FromSqlRow allows you to use the FromSql implementation to convert a single value in a row (tuple) selection into the type. So, because all of my tests for this just used a struct instead of explicitly calling select on a tuple like @sunny-g did, I forgot to add the derive macro. My apologies @pka and thank you @sunny-g for putting this in.
Thanks @sunny-g (and @myaple for checking)!
Thank you both! @pka @myaple
@michaelkirk I'm not, this example is getting an Ewkb
from the union of the individual column.
Am new to both
geozero
anddiesel
, but for the queries I was trying to write, I needed to add this derive to execute the following (truncated) code:The diesel errors were kind of inscrutable, but from what I could surmise, the general issue is that while
st_union_agg
(which is a SQL function I defined to wrap the aggregate version of PostGIS'ST_Union
) returns ageozero::postgis::diesel::sql_types::Geometry
, anEwkb
cannot be obtained from the select statement without explicit conversion, selecting theGeometry
column itself, or without this trait implementation.Sorry I can't provide a better explanation.