We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello,
I wanted to use duckdb-rs to insert a list of items. However, it turns out that this isn't implemented in duckdb-rs. See:
duckdb-rs
List<Type>
Value::List(Vec<Value>)
Value::data_type
Value::List(vec_of_x) => Type::List(Value::data_type(x))
I'm not that advanced in rust. Maybe macros can help here? Anyways, the lack of such collection types in duckdb-rs is a big drawback for me.
The text was updated successfully, but these errors were encountered:
BTW, I'm able to hack this with the following:
CREATE TABLE x (model STRUCT(mx DOUBLE, my DOUBLE, mz DOUBLE))
and then calling:
conn.execute("INSERT INTO x (model) values(?)", params![serde_json::json!(model_struct).to_string()])
i.e. I pass a Value::Text as a serialized JSON string, and duckdb is able to reimplement that transparently as a struct/list etc.
Value::Text
Sorry, something went wrong.
No branches or pull requests
Hello,
I wanted to use
duckdb-rs
to insert a list of items. However, it turns out that this isn't implemented induckdb-rs
. See:It seems to me that the main reason this is the case, is that the underlying duckdb type (https://github.com/duckdb/duckdb-rs/blob/main/crates/duckdb/src/types/mod.rs#L89) expects to pass the type of the underlying elements (e.g.
List<Type>
). I think we need some kind of compiler introspection of the underlyingValue::List(Vec<Value>)
type, i.e. if we want to continue implementingValue::data_type
from https://github.com/duckdb/duckdb-rs/blob/main/crates/duckdb/src/types/value.rs#L237 we would do:I'm not that advanced in rust. Maybe macros can help here? Anyways, the lack of such collection types in duckdb-rs is a big drawback for me.
The text was updated successfully, but these errors were encountered: