-
Notifications
You must be signed in to change notification settings - Fork 93
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
Passing a map as an argument to a query #42
Comments
Thanks for reporting this. Do you have some sample code that I can use to probably add the missing data type. That would be great. Thanks! |
Thanks for the response and sorry for the delay! I actually hope to have a PR opened up next week some time. |
No worries, I've already started with a PR. But the serialisation of the |
After I have racked my brain about serializing a map to a query parameter, I have checked the DuckDB APIs for prepared statements and have found no way to bind a map to a parameter. After thinking twice about it, I'm unsure what your use case is. |
Hey @marcboeker, I have a motivating example for the same issue except with a slice. This fails with the error
|
Hi @andyyu2004, thanks for the example. As we're internally using the DuckDB parameter bind API, there is currently no function for binding slices. A dirty hack would be to interpolate the placeholder with multiple placeholders an then iterating over the slice and binding each item separately. But I would highly suggest to avoid this, as it can get ugly quickly. For these kind of use-cases I have used sqlx in the past. See the example under the "IN queries" section on this page. Maybe you could try this? |
Thank you for creating this library (and just merging #40 for static builds)!
I created a table with a column with a map datatype and when I attempt to insert a record using the
Map
type I am getting the error:I noticed this line has a TODO. Is this for supporting additional data types as passed arguments to queries? Is it a matter at filling out more of these cases?
The text was updated successfully, but these errors were encountered: