Skip to main content

Crate sz_orm_model

Crate sz_orm_model 

Source
Expand description

SZ-ORM Model Trait

Core model abstractions for SZ-ORM:

  • Model trait: all ORM models must implement this
  • ActiveRecord trait: active record pattern
  • Accessor / Mutator: field-level getters/setters
  • Behavior: pluggable lifecycle hooks
  • DirtyTracker: change tracking for fields

Re-exports§

pub use accessors::*;
pub use behaviors::*;
pub use db_type::*;
pub use dialect::*;
pub use dirty_attributes::*;
pub use error::*;
pub use executor::*;
pub use hooks::*;
pub use model::*;
pub use result_map::*;
pub use sql_safety::*;
pub use value::*;

Modules§

accessors
Accessors / Mutators + Attribute Casting
behaviors
行为系统(Behaviors)— 可插拔代码复用单元
db_type
数据库类型定义
dialect
不同数据库的方言抽象
dirty_attributes
脏字段追踪(Dirty Attributes)+ @DynamicInsert / @DynamicUpdate
error
错误类型与处理
executor
执行器 trait(模型层与执行层的契约)
hooks
钩子系统(Hooks)— 软删除 + 多租户
model
模型抽象层
result_map
ResultMap 高级映射 + Native Query + ResultSetMapping
sql_safety
SQL 安全工具:标识符与外键动作校验
value
Value 类型定义

Attribute Macros§

async_trait