⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Discussion options

You must be logged in to vote

As you can see for some reason the ST_GEOMFROMTEXT function is interpreted as a variable.

Not exactly. It's a bit confusing, but sqlc has simply picked a name for the parameter struct field based on the function name. If you aren't happy with the name, you can use sqlc.arg() to change it like this: ($1, $2, ST_GEOMFROMTEXT(sqlc.arg(location))).

Why does this happen? How can I deal with this?

I will assume by "this" you mean "the struct field for the location query parameter has type interface{} rather than types.PostGISPoint" since I've already addressed the naming issue above.

@orisano provides a good explanation above of the type inference issues involved. The ST_GEOMFROMTEXT functi…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@tamis-laan
Comment options

@orisano
Comment options

@tamis-laan
Comment options

@tamis-laan
Comment options

@orisano
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by andrewmbenton
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants