-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add PostGIS support. #534
Add PostGIS support. #534
Conversation
I'm reluctant to depend on JDBC for these data types. How hard would it be to implement them and their parsers in Scala? |
Yep understandable. I think re-implementing the parsing shouldn't be too awful, at least for the basic types. I'll try throwing something minimal together and get a better feel for how much will be involved, then update this. |
Also a compile error for 2.12, looks like. |
build.sbt
Outdated
lazy val postgis = crossProject(JVMPlatform, JSPlatform) | ||
.crossType(CrossType.Pure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!!
@tpolecat I've reworked it and wanted to get an initial opinion from you if this direction seems okay to you. I'm jumping in the deep on PostGIS. Seems like being able to parse Well Known Binary (WKB) and/or Well Known Text (WKT) may be a solution. |
I will try to have a look at this soon. Thanks! |
So I'm almost apologetic about this, but the scope of this expanded far more than I originally intended. Some of this probably isn't necessary to take on in skunk and could be broken into its own library, but ultimately made it easier to create tests to build my own confidence. Plus is gave me an excuse to finally play around with cats-parse. Definitely looking for feedback, the good, the bad and the ugly. Willing to massage this into a form you're comfortable with. Or even blow it up and take it back to basics. |
} | ||
|
||
def coordinate(implicit byteOrdering: ByteOrdering, ewkb: EWKBType): Scodec[Coordinate] = { | ||
// TODO: Why is this val assignment necessary? Scala 3 complains without it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this issue seems to go away when using scala 3.0.2 instead of 3.0.1
Very interesting! Is this PR still under consideration? |
If someone wants to get this in to a mergeable state again, for sure. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #534 +/- ##
==========================================
+ Coverage 84.45% 85.59% +1.14%
==========================================
Files 129 135 +6
Lines 1769 2034 +265
Branches 177 228 +51
==========================================
+ Hits 1494 1741 +247
- Misses 275 293 +18 ☔ View full report in Codecov by Sentry. |
Did my best to resurrect this. Appears to be passing CI. Let me know if there's any changes/enhancements you'd like to see. |
Thanks @cranst0n! |
Backport #534 (PostGIS support) to series/0.6.x
Preliminary crack at adding PostGIS codecs, using the PostGIS JDBC driver types. I based of this stuff on the way PostGIS support is done in doobie.
Note that this changes the Docker image to add the PostGIS extension, which may have CI consequences I can't foresee, but it works on my machine 😎.