Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is this possible to apply function to each item of sqlc.slice? #3203

Unanswered
umed asked this question in Q&A
Discussion options

Hi guys,

So, I have mysql table with key column of uuid type (binary[16]). I would like to select multiple values at once using IN and sqlc.slice:

-- name: QueryName :many
SELECT *
FROM mytable
WHERE id in (sqlc.slice(ids));

But I need to pass each item of slice to UUID_TO_BIN, so above query would map to something like this:

-- name: QueryName :many
SELECT *
FROM mytable
WHERE id in (UUID_TO_BIN(id1), UUID_TO_BIN(id2), ...);

Is there any way to achieve this?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /