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

Add support for in(val1,val2,...) syntax #1769

Closed
kristijorgji opened this issue Aug 3, 2022 · 2 comments
Closed

Add support for in(val1,val2,...) syntax #1769

kristijorgji opened this issue Aug 3, 2022 · 2 comments
Labels
enhancement New feature or request triage New issues that hasn't been reviewed

Comments

@kristijorgji
Copy link
Contributor

kristijorgji commented Aug 3, 2022

What do you want to change?

I would like to have support for select * from table where id in (pleaseaddsupport)

For example the one below is not supported correctly

/* name: GetExercisesByIds :many */
SELECT *
FROM exercises where id in (?);

The id is generated as a string not as array of strings in the query

func (q *Queries) GetExercisesByIds(ctx context.Context, id string)

I called that function with id value of "'0055bd0b-8629-490d-8552-906d04dfca84,0162e545-2678-4cde-a291-665dcf6251a4"'

or "0055bd0b-8629-490d-8552-906d04dfca84,0162e545-2678-4cde-a291-665dcf6251a4"

and does not work with multiple values.
The same query in the mysql console works great

select * from exercsies where id in ('0055bd0b-8629-490d-8552-906d04dfca84,0162e545-2678-4cde-a291-665dcf6251a4"')

returned for me 2 rows.

What database engines need to be changed?

MySQL

What programming language backends need to be changed?

Go

@kristijorgji kristijorgji added enhancement New feature or request triage New issues that hasn't been reviewed labels Aug 3, 2022
@kristijorgji kristijorgji changed the title support in (1, 2, 3) syntax for queries Fails when using in (listofvalues) or JOIN Aug 3, 2022
@kristijorgji kristijorgji changed the title Fails when using in (listofvalues) or JOIN Fails when using inner join Aug 3, 2022
@kristijorgji kristijorgji reopened this Aug 3, 2022
@kristijorgji kristijorgji changed the title Fails when using inner join Add support for in(val1,val2,...) syntax Aug 3, 2022
@Jille
Copy link
Contributor

Jille commented Aug 23, 2022

This is being tracked in #695

@kyleconroy
Copy link
Collaborator

Duplicate of #695

@kyleconroy kyleconroy marked this as a duplicate of #695 Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

3 participants