lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.12k stars 910 forks source link

[Discussion] Postgis support through EWKB #268

Closed cridenour closed 10 years ago

cridenour commented 10 years ago

I've been working on extending pq to read and write the Postgis Extensions to well-known binary. Rather than rely on functions to convert it to WKT or EWKT (well-know text, etc). It helps that this is how Postgis stores the data, but mainly it just seemed fun.

It involves a bit of binary code but otherwise just exposes a lot of types (56 to be exact). Is this something you would want to see in the main pq repo as a pull request? I'm happy to maintain it as a separate library but it does seem to me a similar situation as hstore support.

msakrejda commented 10 years ago

I'm somewhat inclined to leave it separate given that pulling in one more package in your Go app is not really a big deal and that the integration points with the driver itself are pretty clean, but I'm not opposed to it if other maintainers feel strongly.

cridenour commented 10 years ago

@deafbybeheading Thanks for your thoughts. For now I'll plan on keeping it separate, but try to follow some of the coding styles used in pq in case this changes in the future.

johto commented 10 years ago

I think 56 different types is a bit heavy. I see the analogy to hstore, but on the other hand, PostGIS lives completely outside of the project whereas hstore doesn't (though it's not in core postgres proper). I'd also prefer to keep the projects separate. If there's some support you need from the driver that would help you do this better, it would be great to hear about it though!

Closing this issue; feel free to reopen if you feel something's changed enough that we should reconsider.