Skip to main content

sz_orm_model/
lib.rs

1//! SZ-ORM Model Trait
2//!
3//! Core model abstractions for SZ-ORM:
4//! - `Model` trait: all ORM models must implement this
5//! - `ActiveRecord` trait: active record pattern
6//! - `Accessor` / `Mutator`: field-level getters/setters
7//! - `Behavior`: pluggable lifecycle hooks
8//! - `DirtyTracker`: change tracking for fields
9
10// 重新导出外部 crate 的 async_trait,使模块内可用 crate::async_trait
11pub use async_trait::async_trait;
12
13pub mod accessors;
14pub mod behaviors;
15pub mod db_type;
16pub mod dialect;
17pub mod dirty_attributes;
18pub mod error;
19pub mod executor;
20pub mod hooks;
21pub mod model;
22pub mod result_map;
23pub mod sql_safety;
24pub mod value;
25
26pub use accessors::*;
27pub use behaviors::*;
28pub use db_type::*;
29pub use dialect::*;
30pub use dirty_attributes::*;
31pub use error::*;
32pub use executor::*;
33pub use hooks::*;
34pub use model::*;
35pub use result_map::*;
36pub use sql_safety::*;
37pub use value::*;
38
39/// 批量操作的默认分片大小。
40///
41/// 用于 `QueryBuilder::build_batch_insert_chunked` 等方法,
42/// 当数据量超过此值时自动拆分为多条 SQL 执行,避免超过数据库参数上限。
43pub const DEFAULT_BATCH_SIZE: usize = 1000;