-
Notifications
You must be signed in to change notification settings - Fork 127
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 insert lists, maps, and structs? #81
Comments
Haven’t been supported in rust yet |
@wangfenjin appreciate your work! Just want to insert here that missing insert of lists is a deal breaker for my projects. Hope to see that implemented soon. Cheers! |
Recent support for Union types too. 👍🏼 Natural fits with Rust's enum. |
Hope this feature can be supported. If you don't have time, I can write a PR for that. |
@neverchanje it'll be great if you can help. Thanks |
Would be great if we could also be able to retrieve SRUCT, MAP, ENUMs and UNION along with being able to insert them. I think the insert just needs string representation vs the retrieval needs to be convert from arrow format? Am I correct @wangfenjin ? |
Correct.
|
The overall idea is in order to make it easier for users, we need to implement the convert logic of from/to sql. After doing this, you will be more familiar with the rust API and also the C API |
And please add some tests to the new features, feel free to support one type a time |
I think struct/enums/unions would likely need some kind of derivation support via proc macros. This is an interesting example for clickhouse client where the author modified serde to enable support for struct <-> row mapping. See |
@wangfenjin If I try like in point 3, it says (edited out the error; I just had to add the relevant features). Could you show an example, please, of how I can insert a String (valid JSON String) or a Will duckdb-rs add native support for Rust data types (struct/enum at least)? |
Maybe I missed it, but I couldn't see how to insert a row if one of the columns is e.g.
TEXT[]
. I naively triedparams![a_vec_of_str]
butToSql
is only implemented forVec<u8>
(I guess for blobs).The DuckDB docs aren't super clear but it looks like you're supposed to use
list_create('a', 'b', 'c')
but I'm not sure how to do that withparams![]
.The text was updated successfully, but these errors were encountered: