pub struct Schema {Show 14 fields
pub name: String,
pub collection: String,
pub id_prefix: String,
pub timestamps: bool,
pub fields: HashMap<String, FieldDef>,
pub relations: HashMap<String, RelationDef>,
pub computes: Vec<(String, ComputeDef)>,
pub triggers: Triggers,
pub read: Option<Vec<String>>,
pub write: Option<Vec<String>>,
pub indexes: Vec<Value>,
pub source: Option<String>,
pub database: Option<String>,
pub schema: Option<String>,
}Fields§
§name: String§collection: String§id_prefix: String§timestamps: bool§fields: HashMap<String, FieldDef>§relations: HashMap<String, RelationDef>§computes: Vec<(String, ComputeDef)>保持注册顺序:build_agg_stages 的输出顺序依赖它
triggers: Triggers写触发器声明(事件 → 触发列表;解析见 super::triggers,规划见 crate::command::triggers)
read: Option<Vec<String>>§write: Option<Vec<String>>§indexes: Vec<Value>原始索引定义([{keys: {...}, options: {...}}]),upsert 条件构建依赖 unique 索引
source: Option<String>数据源名(由 register_batch 的 Location 注入;None = 缺省 default)。
见 crate::datasource
database: Option<String>连接内「库」(由 register_batch 注入;None = 连接默认:Mongo db 实例的库名、
PG 的库、MySQL 的连接库、SQLite 的 main)。
schema: Option<String>连接内「schema」(仅 PG;由 register_batch 注入;None = 连接默认 search_path)。
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more