Open CGenie opened 2 weeks ago
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.
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: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.