Open ttomasz opened 1 year ago
Hi! Thanks for reporting this issue. This seems to be a DBeaver issue? Although I don't expect them to be able to read our internal geometry format (nor do I think that would be a good idea). I don't use DBeaver personally, but perhaps if you transform the GEOMETRY
to WKB or WKT DBeaver can pick it up and display it properly?
I assume there is some standard Geometry type defined by SQL/MM or Simple Features spec and DBeaver knows how to recognize that.
I tried with WKB_BLOB but it's not recognized. Interestingly it's represented as WKT not WKB but column type is marked as WKB_BLOB.
Seems like this is implemented on a case-by-case basis, at least there's special handler code for PostGIS
I'd definitely like to investigate how hard it would be to add something similar for DuckDB, my only concern is that DBeaver should not have to depend on the internal binary format of DuckDB geometries (as thats still evolving), but maybe its possible for DBeaver to intercept and convert the result-set to WKB/WKT before display.
Interesting, for reference this is the switch statement which leads to the class that conditionally builds the geometry.
In DuckDBs case it seems that some types get mapped to struct and some to blob: https://github.com/dbeaver/dbeaver/blob/devel/plugins/org.jkiss.dbeaver.ext.duckdb/src/org/jkiss/dbeaver/ext/duckdb/model/DuckDataTypeCache.java#L67C11-L67C11
It would be nice if GEOMETRY type was recognized by DBeaver which has a spatial viewer.
Right now creating geometry by using e.g. ST_Point results in having a geometry column but there is no option to display it on a map like it would be with a Postgis database.