sz-orm-sqlx 10.13.2

sqlx adapter: MySQL, PostgreSQL, SQLite backend via sqlx crate
Documentation
[package]

name = "sz-orm-sqlx"

description = "sqlx adapter: MySQL, PostgreSQL, SQLite backend via sqlx crate"

version.workspace = true

edition.workspace = true

authors.workspace = true

license.workspace = true

repository.workspace = true

homepage.workspace = true

keywords.workspace = true

categories.workspace = true



[dependencies]

sz-orm-core = { workspace = true }

async-trait.workspace = true

tokio = { workspace = true, features = ["sync"] }

serde = { workspace = true }

serde_json = { workspace = true }

sqlx = { version = "0.9", default-features = false, features = ["runtime-tokio", "tls-rustls", "mysql", "postgres", "sqlite", "chrono", "json", "rust_decimal", "bigdecimal", "uuid"] }

rust_decimal = "1.36"

# R2:NUMERIC/DECIMAL(38) 无损解码(rust_decimal 仅 96 位尾数,会在 29 位有效数字处截断)

bigdecimal = "0.4"

# 流式查询:try_stream! 宏实现 Connection::query_stream

async-stream = "0.3"

# Stream trait 与 StreamExt::next(fetch 流式结果迭代)

futures.workspace = true

# 锁毒化修复:使用 parking_lot 替代 std::sync,消除 .lock().unwrap() panic 风险

parking_lot.workspace = true

# v2.2.0: Oracle/MSSQL 后端 optional 依赖,通过 feature gate 启用

sz-orm-oracle = { workspace = true, optional = true }

sz-orm-mssql = { workspace = true, optional = true }

# v4.9.0 TASK-003: SAP HANA 真实驱动(hdbconnect_async v0.32.0,纯 Rust async + bb8 连接池)

hdbconnect_async = { version = "0.32", optional = true }

# v9.5.0 SlowQueryGuard 依赖 observability 的 QueryLogger

sz-orm-observability = { path = "../sz-orm-observability", version = "10.12.0", optional = true, features = ["query-logging"] }



[features]

default = ["auto-prewarm"]

slow-query-capture = ["dep:sz-orm-observability"]

# v2.2.0 A-1: 启用 Oracle 后端支持(AnyPool 运行时切换)

oracle = ["dep:sz-orm-oracle"]

# v2.2.0 A-1: 启用 MSSQL 后端支持(AnyPool 运行时切换)

mssql = ["dep:sz-orm-mssql"]

# v4.9.0 TASK-003: SAP HANA 真实驱动桥接(hdbconnect_async,默认不启用)

dialect-saphana-driver = ["dep:hdbconnect_async"]

# v3.2.0:转发 auto-prewarm feature 到 sz-orm-core

auto-prewarm = ["sz-orm-core/auto-prewarm"]

# v6.5.0:异步流式结果集(SqlxRowStream 三后端真游标)

async-row-stream = ["sz-orm-core/async-row-stream"]

# v6.5.0:查询计划缓存(PreparedStatementCache 句柄复用)

prepared-stmt-cache = ["sz-orm-core/prepared-stmt-cache"]

# v7.5.0:CockroachDB 真实 DB 验证测试(复用 postgres 协议,不新增驱动依赖)

cockroachdb = []

# v7.5.0:YugabyteDB 真实 DB 验证测试(复用 postgres 协议,不新增驱动依赖)

yugabytedb = []

# v7.6.0:数据库后端兼容性验证

db-backend-compat = []



[dev-dependencies]

tokio = { workspace = true, features = ["full", "test-util"] }

proptest = { workspace = true }

# 流式查询测试:StreamExt::next(与主依赖同一 workspace 版本,零额外编译)

futures.workspace = true

# 2026-10-28 P1-3:查询指标接线测试(install_query_metrics + 全局 AlertMetricHandles)

sz-orm-observability = { path = "../sz-orm-observability" }



[lib]

name = "sz_orm_sqlx"

path = "src/lib.rs"



[[test]]

name = "sqlx_adapter_tests"

path = "tests/sqlx_adapter_tests.rs"



[[test]]

name = "real_db_pool_tests"

path = "tests/real_db_pool_tests.rs"



[[test]]

name = "real_db_jepsen"

path = "tests/real_db_jepsen.rs"



[[test]]

name = "benchmark"

path = "tests/benchmark.rs"



[[test]]

name = "differential_fuzz"

path = "tests/differential_fuzz.rs"



[[test]]

name = "saphana_e2e"

path = "tests/saphana_e2e.rs"

required-features = ["dialect-saphana-driver"]



[[test]]

name = "cockroachdb_test"

path = "tests/cockroachdb_test.rs"

required-features = ["cockroachdb"]



[[test]]

name = "yugabytedb_test"

path = "tests/yugabytedb_test.rs"

required-features = ["yugabytedb"]



[[test]]

name = "distributed_db_compat_report_test"

path = "tests/distributed_db_compat_report_test.rs"



[[test]]

name = "unified_pool_test"

path = "tests/unified_pool_test.rs"



[lints]

workspace = true