#derive #surrealdb #obj #schema #surrealdb-schema-derive #thing #derive-debug

surrealdb-obj-derive

由 surrealdb-schema-derive 衍生而来

2 个版本

0.1.1 2022年11月14日
0.1.0 2022年11月12日

#1971数据库接口

Download history 8/week @ 2024-03-01 6/week @ 2024-03-22 108/week @ 2024-03-29 4/week @ 2024-04-05 84/week @ 2024-06-07 9/week @ 2024-06-14

93 每月下载量
用于 app-db-schema

MIT 许可证

20KB
409 行代码

  • 请检查 impl/src/lib.rs

  • 用法

#[derive(Debug, Clone)]
pub struct Relation {
    pub id: Thing,
    pub from: Thing,
    pub with: Thing,
}

impl TryFrom<surrealdb_obj_derive::SurrealValue> for Relation {}

参考 crate 架构

#[derive(SurrealDbObject, Debug, Clone)]
pub struct Mobile {
    pub id: u64,
}
  • 发布
cargo install cargo-release
cargo release publish --workspace --registry crates-io --execute
cargo release push  --execute
# cargo publish --no-verify

依赖关系

~84MB
~1.5M SLoC