-
Notifications
You must be signed in to change notification settings - Fork 2
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
Accept multiple --id
options
#19
Conversation
This is a breaking change because custom copy-out queries will need to change conditions from |
@allenap Great point. I wonder if we could just run each user-defined query once for each |
This will break for a query like: select * from example_table
where id_column = :id
or id_column is null because we'll fetch those In custom copy-out queries we could instead replace select * from example_table
where id_column = ANY (ARRAY[...])
or id_column is null I've read that PostgreSQL treats Queries like: select * from example_table
where id_column in (:id, 'some-fixed-value') will not work, but they won't work with the I'll try it out. |
@jelder I've added a cast based on the column's select * from example_table
where uuid_column = :id into: select * from example_table
where uuid_column = any (array[...]) and PostgreSQL complains "operator does not exist: uuid = text" about that. This is a confusing error message. I think we're better off sticking with the original breaking change. What do you think? |
@allenap I'm somewhat confused, after your change to cast the array it works? or it still fails? |
It works with the explicit type casting that I added, e.g.: select * from example_table
where uuid_column = any (array[...] :: uuid[]) but it feels overcomplicated. I think it's better to take the incompatibility hit of changing There's another way:
We could use select * from example_table
where column = :id and the IDs "foo" and "bar", we would generate the following query: select * from example_table
where column = 'foo'
union
select * from example_table
where column = 'bar' Upside: simple, it works (probably).
My conclusion remains as before: switch from |
I agree w/ @allenap, |
What do you think @jelder ? |
It's a breaking change, so we need to reflect that in the version when we release it. Also, the animated gif would have to be regenerated (it's in code). Could we continue to support |
👍
Good point. I will do it as a separate commit/merge to main, so that it shows the correct release version information.
Yes; this PR does that. |
d694302
to
0fa82a6
Compare
Updated to use |
It's useful to be able to get a database slice for multiple identifiers in a single pass.