sz-orm-core 1.2.2

Core ORM engine: Model trait, ActiveRecord, QueryBuilder, Pool, Transaction, migration, and SQL dialect abstraction
Documentation
[package]
name = "sz-orm-core"
description = "Core ORM engine: Model trait, ActiveRecord, QueryBuilder, Pool, Transaction, migration, and SQL dialect abstraction"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true

[features]
default = []
testing = ["tokio/full"]
# 启用 query! 宏的编译期连真实 DB 验证能力(转发至 sz-orm-macros/db-verify)
db-verify = ["sz-orm-macros/db-verify"]
# 启用 L2Cache 的 Redis 分布式后端(Fix #39:真实实现,基于 redis 0.27 + tokio-comp + connection-manager)
redis = ["dep:redis"]
# #88 修复:断路器与 ORM 执行路径集成(引入 sz-orm-health 的 CircuitBreaker)
circuit-breaker = ["sz-orm-health"]
# #93 修复:限流器与 ORM 执行路径集成(引入 sz-orm-limit 的 RateLimiter)
rate-limit = ["sz-orm-limit"]

[dependencies]
async-trait.workspace = true
tracing.workspace = true
thiserror.workspace = true
serde.workspace = true
serde_json.workspace = true
chrono.workspace = true
bytes.workspace = true
tokio = { workspace = true, features = ["sync", "time", "rt", "macros"] }
# P3-4 修复:使用 parking_lot::RwLock 替换 std::sync::RwLock,消除锁毒化风险
# parking_lot 的 RwLock 不会返回 PoisonError,无需 unwrap(),且性能更好
parking_lot.workspace = true
# v1.1.0 优化 2:Pool 无锁队列(crossbeam-queue::ArrayQueue 替换 Mutex<VecDeque>)
crossbeam-queue.workspace = true
# 流式查询:Connection::query_stream 默认实现需要 futures::stream::empty
futures.workspace = true
sz-orm-sql-validator = { version = "1.2.2", path = "../sz-orm-sql-validator" }
sz-orm-macros = { version = "1.2.2", path = "../sz-orm-macros" }
# 核心包拆分(v1.2.1):sz-orm-core 退化为纯 re-export 层,
# 四个子模块各自独立为 crate,core 仅通过 glob re-export 统一对外接口。
sz-orm-model = { version = "1.2.2", path = "../sz-orm-model" }
sz-orm-pool = { version = "1.2.2", path = "../sz-orm-pool" }
sz-orm-query = { version = "1.2.2", path = "../sz-orm-query" }
sz-orm-migration = { version = "1.2.2", path = "../sz-orm-migration" }
# #88 修复:可选断路器依赖(启用 circuit-breaker feature 时生效)
sz-orm-health = { version = "1.2.2", path = "../sz-orm-health", optional = true }
# #93 修复:可选限流器依赖(启用 rate-limit feature 时生效)
sz-orm-limit = { version = "1.2.2", path = "../sz-orm-limit", optional = true }
# Fix #39:L2Cache RedisBackend 真实实现(启用 redis feature 时生效)
# 使用 connection-manager 自动重连 + tokio-comp 异步 IO
redis = { workspace = true, optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["full", "test-util"] }
sqlx = { version = "0.9", default-features = false, features = ["runtime-tokio", "tls-rustls", "mysql", "postgres", "sqlite", "chrono", "json"] }
rusqlite = { version = "0.32", features = ["bundled"] }
oracle = { version = "0.6", default-features = false, features = ["chrono"] }
criterion = { version = "0.5", features = ["html_reports", "async_tokio"] }
# v0.2.1 修复 T-1:Property-Based Testing
proptest = { workspace = true }

[lib]
name = "sz_orm_core"
path = "src/lib.rs"

[[test]]
name = "core_tests"
path = "tests/core.rs"

[[test]]
name = "integration_sqlite"
path = "tests/integration_sqlite.rs"

[[test]]
name = "integration_mysql"
path = "tests/integration_mysql.rs"

[[test]]
name = "integration_pg"
path = "tests/integration_pg.rs"

[[test]]
name = "integration_oracle"
path = "tests/integration_oracle.rs"

[[test]]
name = "contracts"
path = "tests/contracts.rs"

# v0.2.1 修复 T-1:Property-Based Testing 入口
[[test]]
name = "property"
path = "tests/property.rs"

# v0.2.1 阶段十五:Soak Test 入口(默认 ignored,CI 24h 任务运行)
[[test]]
name = "soak"
path = "tests/soak.rs"

# 连接池混沌工程测试
[[test]]
name = "chaos_pool"
path = "tests/chaos_pool.rs"

[[bench]]
name = "core_bench"
path = "benches/core_bench.rs"
harness = false

[[bench]]
name = "production_bench"
path = "benches/production_bench.rs"
harness = false

# P2-8:高并发连接池基准测试
[[bench]]
name = "concurrency_bench"
path = "benches/concurrency_bench.rs"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true