https://github.com/KipData/FnckSQL
代码语言:javascript复制let fnck_sql = Database::with_kipdb("./data").await?;
let tupes = db.run("select * from t1").await?;
#[derive(Default, Debug, PartialEq)]
struct MyStruct {
c1: i32,
c2: String,
}
implement_from_tuple!(
MyStruct, (
c1: i32 => |inner: &mut MyStruct, value| {
if let DataValue::Int32(Some(val)) = value {
inner.c1 = val;
}
},
c2: String => |inner: &mut MyStruct, value| {
if let DataValue::Utf8(Some(val)) = value {
inner.c2 = val;
}
}
)
);