Uhm what?
At least in .NET+SQL Server land you can give your SQL queries named parameters. If there's a mismatch you'll get an exception saying so...
Perhaps this is a problem in some other stack (PHP?)
Uhm what?
At least in .NET+SQL Server land you can give your SQL queries named parameters. If there's a mismatch you'll get an exception saying so...
Perhaps this is a problem in some other stack (PHP?)
EDIT: To those mentioning migrations, note that reviewing migrations are like reviewing patches. Sometimes you want to not review a specific patch but rather look at the whole method, and `blame` a specific line or three to get an idea of what the previous developer's intention was. You can't get that type of overview from reviewing each patch or migration.
Add user-defined table types used as parameters and you've got a good way to pass batches of data too.
This is can be automatically handled if your ORM supports it; even a micro-ORM like Dapper does.
Otherwise my go-to solution for this if it isn't supported is to pass the collection as a user-defined table type, filled with the values. you can either use WHERE IN or join on this table variable.
EDIT: my perspective on this if from working with SQL Server and .NET. I don't know enough about Python or PHP development to comment on those.
You still have to write your SQL statements, and in your example you'd still be able to refer to your array by name:
select SomethingID where AnotherThing in @yourNamedArrayParameter
More here: https://github.com/StackExchange/Dapper#list-supportIf you're not using Dapper just use a user-defined table type to hold your data and join on it instead of using WHERE IN.