Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GEOMETRY type recognizable by DBeaver #142

Open
ttomasz opened this issue Oct 14, 2023 · 4 comments
Open

Make GEOMETRY type recognizable by DBeaver #142

ttomasz opened this issue Oct 14, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@ttomasz
Copy link

ttomasz commented Oct 14, 2023

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.

@Maxxen
Copy link
Member

Maxxen commented Oct 14, 2023

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?

@ttomasz
Copy link
Author

ttomasz commented Oct 20, 2023

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.
image

@Maxxen
Copy link
Member

Maxxen commented Oct 25, 2023

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.

@ttomasz
Copy link
Author

ttomasz commented Oct 28, 2023

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

@Maxxen Maxxen added feature request enhancement New feature or request and removed feature request labels Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants