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

Support for postgis geometry parent type #483

Closed
javieronsurbe opened this issue Jan 24, 2022 · 2 comments · May be fixed by earlbread/r2dbc-postgresql#1
Closed

Support for postgis geometry parent type #483

javieronsurbe opened this issue Jan 24, 2022 · 2 comments · May be fixed by earlbread/r2dbc-postgresql#1
Labels
type: enhancement A general enhancement
Milestone

Comments

@javieronsurbe
Copy link

Feature Request

PostGIS have support to define a generic geometry type for fields that can contains points, polygons, etc. and this kind of field is supported in Postgres JDBC version using an abstract class that specific ones can inherit.

Can we have some similar behavior in r2dbc one? I.e.- Declaring a field in a POJO of type Geometry (abstract) and when it is recovered from database from a table field of type geometry it is mapped to a specific type (Point, Polygon, etc.)

As I see specific ones support are added (0.8.5 version), maybe it's not very difficult to add this enhancement to driver

Thanks!

@javieronsurbe javieronsurbe added the type: enhancement A general enhancement label Jan 24, 2022
@mp911de
Copy link
Collaborator

mp911de commented Jan 24, 2022

R2DBC's extension model is based on codecs so plugin authors can bring their own type hierarchy. Looking though the code of Postgis JDBC, I haven't found how Postgis registers itself with the JDBC driver. I think you could reuse the same types and provide a Postgis codec to natively read into Geometry types and write such.

Take a look at the HSTORE codec that is being registered conditionally if HSTORE is present: https://github.com/pgjdbc/r2dbc-postgresql/blob/main/src/main/java/io/r2dbc/postgresql/codec/BuiltinDynamicCodecs.java#L32

@javieronsurbe
Copy link
Author

javieronsurbe commented Jan 24, 2022 via email

earlbread added a commit to earlbread/r2dbc-postgresql that referenced this issue Feb 6, 2022
[resolves pgjdbc#483]

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
@earlbread earlbread mentioned this issue Feb 6, 2022
4 tasks
earlbread added a commit to earlbread/r2dbc-postgresql that referenced this issue Feb 8, 2022
[resolves pgjdbc#483]

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
earlbread added a commit to earlbread/r2dbc-postgresql that referenced this issue Feb 8, 2022
[resolves pgjdbc#483]

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
earlbread added a commit to earlbread/r2dbc-postgresql that referenced this issue Feb 16, 2022
[resolves pgjdbc#483]

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
@mp911de mp911de added this to the 0.9.1.RELEASE milestone Feb 16, 2022
mp911de added a commit that referenced this issue Feb 16, 2022
Use this. for instance field access. Align license headers. Simplify classpath detection.

[#483][closes #491]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
mp911de pushed a commit that referenced this issue Feb 16, 2022
[resolves #483][#491]

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
mp911de added a commit that referenced this issue Feb 16, 2022
Use this. for instance field access. Align license headers. Simplify classpath detection.

[#483][closes #491]

Signed-off-by: Mark Paluch <mpaluch@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants