We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to upgrade from v1.27.3 to v1.30.0 and it is giving me this issue.
v1.27.3
v1.30.0
I have this statement composing my query:
sb.Equal("data->'$.some.field'", 123)
And it encoded it like this:
SELECT COUNT(*) FROM table WHERE id = ? AND deleted_at IS NULL AND data->'$$.some.field' = ?
Which produced this error:
Error 3143 (42000): Invalid JSON path expression. The error is around character position 1.
Note the double $$ in the query.
$$
I manually replaced it with strings.ReplaceAll(qry, "$$", "$") and the query worked again.
strings.ReplaceAll(qry, "$$", "$")
Is this a bug or I'm missing something?
Edit: with version v1.29.0 works fine. It is a problem with v1.30.0.
v1.29.0
(my driver is github.com/go-sql-driver/mysql v1.8.1) (full builder code would be something like this:)
github.com/go-sql-driver/mysql v1.8.1
sb := sqlbuilder.Select("COUNT(*)").From("table") where := []string{ sb.Equal("data->'$.some.field'", 123), /* more... */} qry, args := sb.Where(where...).Build()
The text was updated successfully, but these errors were encountered:
It's a bug. Thanks for reporting this to me.
Sorry, something went wrong.
c329655
Fixed in tag v1.30.1.
No branches or pull requests
I'm trying to upgrade from
v1.27.3
tov1.30.0
and it is giving me this issue.I have this statement composing my query:
And it encoded it like this:
Which produced this error:
Error 3143 (42000): Invalid JSON path expression. The error is around character position 1.
Note the double
$$
in the query.I manually replaced it with
strings.ReplaceAll(qry, "$$", "$")
and the query worked again.Is this a bug or I'm missing something?
Edit: with version
v1.29.0
works fine. It is a problem withv1.30.0
.(my driver is
github.com/go-sql-driver/mysql v1.8.1
)(full builder code would be something like this:)
The text was updated successfully, but these errors were encountered: