5个版本
| 0.2.3 | 2022年4月2日 |
|---|---|
| 0.2.2 | 2021年2月24日 |
| 0.2.0 | 2021年2月24日 |
| 0.1.1 | 2020年12月3日 |
| 0.1.0 | 2020年12月3日 |
在#mysql 中排名 244
用于 into_query
10KB
182 代码行
into_query_derive
免责声明
本crate仅通过into_query的derive功能使用。此文档直接从into_query复制
用法
#[derive(IntoQuery)]
#[table_name = "whateverlol"]
pub struct Filter {
foo: Option<String>,
bar: Option<Vec<i32>>,
baz: Option<Vec<u8>>,
}
功能
mysql, postgres, sqlite:设置查询构建器使用的后端
属性
table_name:必需
schema::<this>::dsl::<this>
schema_prefix:可选(默认:crate)
<this>::schema::<table_name>::dsl
例如,如果你的项目结构如下
src
│ main.rs
└───db
└───schema.rs
并且你的表是"cats"
#[derive(IntoQuery)]
#[table_name = "cats"]
#[schema_prefix = "crate::db"]
struct CatOptions {
..
}
依赖项
~3–7MB
~150K SLoC