Skip to content
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

sqlx.Named could not find name #947

Open
danqiye1 opened this issue Oct 1, 2024 · 0 comments
Open

sqlx.Named could not find name #947

danqiye1 opened this issue Oct 1, 2024 · 0 comments

Comments

@danqiye1
Copy link

danqiye1 commented Oct 1, 2024

The function sqlx.Named seems to be registering extra bind variables. For example, if I do the following:

sqlx.Named(`select id, title, 'http://example.com' as link 
		from mytable 
		where id = (:input_id)`, map[string]interface{}{"input_id": 1})

I will get the following names

[]string{"", "input_id"}

which means sqlx.Named incorrectly identified the colon in 'http://example.com' as a beginning of a named argument. Is there a way to fix this or perhaps a workaround to this, as I do have regex + hardcoded urls in my CTE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant