Example using PostGis geometry #2598
Replies: 2 comments 2 replies
-
I created a sqlc playground to try this and as far as I can tell the generated code looks fine: https://play.sqlc.dev/p/2942befa870c33a0f1efa332a5f3e9578e657b28948e3bbab98362b9711f1a19 I don't have experience with the geometry data type but this looks like an error you'd get when trying to scan some "invalid" (or maybe just unexpected) data from the database into the Does the insert work if you change the sqlc annotation to |
Beta Was this translation helpful? Give feedback.
-
@andrewmbenton hey yes, it turned out I needed to use a postgis function to construct the point. However this creates a different problem with sqlc: |
Beta Was this translation helpful? Give feedback.
-
I just started using sqlc and I need to combine it using PostGis, specifically to encode GPS coordinates.
I have the following database schema:
I think I should do the following:
Here is my sqlc.yaml config:
If I execute the following:
I get back the error:
parse error - invalid geometry (SQLSTATE XX000)
How would I get this to work properly?
Beta Was this translation helpful? Give feedback.
All reactions