-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
How to pass array of records in parameters with npgsql #2046
Comments
Does |
You might need to flatten that - what is the expected parameter values here? If this was raw ADO.NET, what is it that you're trying to invoke? |
@people is of type record[], postgres literal would be ARRAY[ROW('Nikola', 'Tesla'), ROW('Thomas', 'Edison'), ROW('Georg', 'Ohm')] however, I think my question is not valid anymore as for some reason it is possible to compare two records in postgres, it is impossible to check if record exists in an array |
I don't think that's a scenario we've had cause to look at. I think for now the answer is "we don't have an option for that" - happy to add it to the pile of candidates if it is a useful / common thing. |
How to pass array of records postgres type as a parameter from c#?
I have tried to send it the same way it is received from query result - as double array of objects, but npgsql complains about it:
I guess I need to use DynamicParameters object and specify type name manually, but it accepts enum instead of string and in enum there is no such value like
object
orrecord
.I need it for query like this one:
Can someone guide me how to do it?
The text was updated successfully, but these errors were encountered: