sz-orm-core 6.2.0

Core ORM engine: Model trait, ActiveRecord, QueryBuilder, Pool, Transaction, migration, and SQL dialect abstraction
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
[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]
# 榛樿鍚敤 Redis 鍒嗗竷寮忕紦瀛樺悗绔紙RedisBackend锛夛紝寮€绠卞嵆锟?
default = ["redis", "simd", "l1-cache", "plan-cache", "zero-copy", "auto-prewarm", "perf-zero-copy-l2", "perf-enum-dispatch", "perf-box-str", "dialect-cockroachdb", "dialect-yugabytedb", "dialect-snowflake", "dialect-redshift", "dialect-informix", "dialect-saphana", "dialect-firebird", "prod-redis-tls", "prod-jwt-key-rotation", "prod-metrics-acl", "prod-shutdown-timeout", "prod-leak-detection", "prod-n1-tuning", "prod-pool-tuning", "prod-config-masking", "prod-log-level", "prod-health-endpoint", "prod-probe-endpoint", "prod-circuit-tuning", "prod-rate-limit-tuning", "prod-dialect-security", "cache-coherence", "performance"]
# v4.9.0:OWASP Top 10 完整覆盖渗透测试套件(编译门控,默认关闭)
owasp-pentest-suite = []
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"]
# v3.2.0锛氳繛鎺ユ睜鑷姩棰勭儹澧炲己锛堟笎杩涘紡鍒嗘壒 + 澶氭睜缁熶竴 + 杩涘害鍙娴嬶級
auto-prewarm = []
# v3.2.0锛氭煡璇㈣鍒掔紦瀛橈紙SQL 瑙f瀽/浼樺寲缁撴灉缂撳瓨 + LRU 娣樻卑 + 琛ㄧ骇澶辨晥锟?
plan-cache = ["dep:sqlparser", "dep:twox-hash"]
# v3.2.0锛氶浂鎷疯礉搴忓垪鍖栵紙BorrowedValue + ColumnarResultSet锟?
zero-copy = []
# v3.2.0锛歋IMD 鍔犻€燂紙鎵归噺鏁存暟瑙g爜 + 鍒楁瘮锟?+ 鑷姩闄嶇骇锟?
simd = []
# v3.3.0锛氬绉熸埛涓庢暟鎹殧绂诲寮猴紙绉熸埛涓婁笅鏂囪嚜鍔ㄦ敞锟?+ Schema 闅旂 + 杩炴帴姹犻殧锟?+ 琛岀骇瀹夊叏 + 鍒楃骇鑴辨晱 + 澶氱鎴峰璁★級
multi-tenant-enhanced = ["dep:sz-orm-audit", "dep:sz-orm-masking"]
# v3.3.0锛氬垎甯冨紡缂撳瓨涓€鑷存€э紙璺ㄥ疄渚嬪け锟?+ Write-behind + 缂撳瓨鍑荤┛/闆穿闃叉姢锟?
dist-cache = ["dep:rand", "dep:sz-orm-crypto"]
# v3.4.0锛歋mallString 浼樺寲锛圕ompactString 鏇夸唬 String锛岀煭瀛楃鐡?锟?23 瀛楄妭鍐呰仈瀛樺偍锟?
perf-smallstring = ["dep:compact_str"]
perf-zero-copy-l2 = []
# v3.4.0锛歟num dispatch 浼樺寲锛坢atch 鍒嗗彂鏇夸唬 Box<dyn Dialect> vtable 鏌ユ壘锟?
perf-enum-dispatch = []

perf-box-str = []
# v3.4.0锛氱被鍨嬪畨鍏ㄥ垪寮曠敤锛圕olumn<T> + Schema derive 鍒楀悕甯搁噺锟?
type-safe-columns = ["sz-orm-macros/type-safe-columns"]
# v3.4.0锛氱被鍨嬪寲鍒楋紙Column<T> 鐙珛 feature锛屽厑璁镐粎鍚敤 Column<T> 涓嶅惎锟?Schema 鎵╁睍锟?

# v3.4.0锛氱被鍨嬪寲 DSL锛坱yped_ast.rs Diesel 椋庢牸琛ㄨ揪锟?DSL锟?
typed-dsl = []
# v3.7.0: stable锛堢被鍨嬪畨鍏ㄥ叧鑱旀煡璇紝缂栬瘧鏈熷閿牎楠岋級
typed-relation = []
# v3.7.0: stable锛坧roc-macro 缂栬瘧锟?SQL 楠岃瘉锟?
sql-verify-proc = ["dep:sqlparser", "dep:twox-hash"]
# v3.6.0锛歈ueryBuilder 杩佺Щ宸ュ叿锛坙int + fix + 宸垎娴嬭瘯锟?
qb-migration-tool = ["dep:syn", "dep:quote"]
# v3.5.0锛歀1 缂撳瓨锛圫ession 绾у埆 Identity Map + LRU + AtomicU64 缁熻锟?
l1-cache = []
# v3.5.0锛欳ockroachDB 鏂硅█锛圥G 鍏煎鍒嗗竷寮忔暟鎹簱锛屽锟?PostgreSqlDialect锟?
dialect-cockroachdb = []
# v3.5.0锛歒ugabyteDB 鏂硅█锛圥G 鍏煎鍒嗗竷寮忔暟鎹簱锛屽锟?PostgreSqlDialect锟?
dialect-yugabytedb = []
# v3.6.0锛歋nowflake 鏂硅█锛堜簯鏁颁粨锛岀嫭绔嬪疄鐜帮紝鏀寔 VARIANT/OBJECT/ARRAY + COPY INTO + TIME TRAVEL锟?
dialect-snowflake = []
# v3.6.0锛歊edshift 鏂硅█锛圓WS 浜戞暟浠擄紝濮旀淳 PostgreSqlDialect + COPY/UNLOAD 鐗规€ф墿灞曪級
dialect-redshift = []
# v3.7.0: Informix 鏂硅█锛圫QL generation only锛孲ERIAL/ROW 绫诲瀷 + PUT 璇彞锛屾棤锟?DB 椹卞姩锟?
dialect-informix = []
# v3.7.0: SAP HANA 鏂硅█锛圫QL generation only锛岃绠楀垪 + CE 鍑芥暟锛屾棤锟?DB 椹卞姩锟?
dialect-saphana = []
# v3.7.0: Firebird 鏂硅█锛圫QL generation only锛孏ENERATOR/SEQUENCE + EXECUTE BLOCK锛屾棤锟?DB 椹卞姩锟?
dialect-firebird = []
# v3.7.0锛氱湡锟?DB 绔埌绔祴璇曞浠讹紙杩炴湡锟?MySQL/PostgreSQL/SQLite/Oracle/MSSQL 楠岃瘉 8 绫绘牳蹇冭矾寰勶級
e2e-real-db = []
# v3.8.0锛氱敓浜ч儴缃插氨缁鏌ユ竻鍗曪紙prod-ready feature gate 浣撶郴锟?4 涓瓙 feature锛岄粯璁ゅ叧闂級
# 娉ㄦ剰锛氳法锟?feature 鍦ㄥ悇鑷寘涓嫭绔嬪畾涔夛紝sz-orm-core 浠呰仛鍚堣嚜韬唴锟?feature
prod-redis-tls = []
prod-jwt-key-rotation = []
prod-metrics-acl = []
prod-shutdown-timeout = []
prod-leak-detection = []
prod-n1-tuning = []
prod-pool-tuning = []
prod-config-masking = []
prod-log-level = []
prod-health-endpoint = []
prod-probe-endpoint = []
prod-circuit-tuning = []
prod-rate-limit-tuning = []
prod-dialect-security = []
# prod-ready 锟?feature锛氳仛鍚堟墍鏈夌敓浜у氨缁瓙 feature
prod-ready = [
    "prod-redis-tls",
    "prod-jwt-key-rotation",
    "prod-metrics-acl",
    "prod-shutdown-timeout",
    "prod-leak-detection",
    "prod-n1-tuning",
    "prod-pool-tuning",
    "prod-config-masking",
    "prod-log-level",
    "prod-health-endpoint",
    "prod-probe-endpoint",
    "prod-circuit-tuning",
    "prod-rate-limit-tuning",
    "prod-dialect-security",
]
# v3.9.0锛歜enchmark 濂椾欢 + 鏁版嵁楠岃瘉 + 杩佺Щ dry-run + 娴佸紡瀵煎嚭锛坒eature gate 闅旂锛岄粯璁ゅ叧闂級
benchmark-suite = ["dep:criterion"]
bench-seaorm = ["dep:sea-orm"]
data-validation = ["sz-orm-macros/data-validation", "dep:regex"]
validate-on-write = ["data-validation"]
migration-dry-run = ["dep:regex"]
streaming-export = ["dep:csv"]
# v4.1.0锛氭暟鎹?seeding/fixture 绠$悊 + schema diff 鍙鍖栵紙feature gate 闅旂锛岄粯璁ゅ叧闂級
data-seeding = ["dep:rand", "dep:serde_yaml"]
schema-diff-viz = []
# v4.1.0锛氱紦瀛樹竴鑷存€у崗璁紙MESI 鐘舵€佹満 + 澶辨晥骞挎挱 + Write-through/behind锛?
cache-coherence = []
# v4.1.0锛氳縼绉荤増鏈垎鏀紙澶氬垎鏀苟琛屽紑鍙?+ 鍚堝苟鍐茬獊妫€娴嬶級
migration-branch = []
# v4.3.0 M3:编译期数据治理(PII 标注强制 + 合规报告,feature gate 隔离,默认关闭)
compile-governance = ["sz-orm-macros/governance-derive"]
# v4.3.0 M2:N+1 静态检测标注宏(#[detect_n_plus_one],feature gate 隔离,默认关闭)
n1-lint = ["sz-orm-macros/n1-lint"]
# v4.6.0 M2:迁移回滚自动化(零停机 + 影子表 + 反向 DDL + 健康检查)
zero-downtime-rollback = []
# v4.6.0 M4:连接级多租户隔离(TenantPoolRegistry + 连接池级隔离)
connection-level-tenant = ["multi-tenant-enhanced"]

# v4.7.0 M2:迁移前向兼容性检查与沙箱预演(前向兼容 + 影子表预演 + 依赖图分析)
forward-compat-sandbox = ["zero-downtime-rollback", "migration-dry-run"]
# v4.7.0 M4:租户资源配额与行级安全增强(配额 + RLS 自动注入 + 租户审计)
tenant-quota-rls-enhanced = ["connection-level-tenant"]

# v4.9.0 TASK-004:异常检测(指标采集 + 滑动窗口 + 突增/耗尽检测 + 告警 + 报告)
anomaly-detection = ["dep:sz-orm-anomaly"]
# v4.9.1:性能优化组合(一键启用 SIMD 向量化 + L1 缓存 + 查询计划缓存 + 零拷贝)
performance = ["simd", "l1-cache", "plan-cache", "zero-copy"]
# v5.0.0:图数据库适配层(接入 sz-orm-graph InMemoryGraphEngine,提供 graph_query/graph_add_node/graph_add_relationship 入口)
graph = ["dep:sz-orm-graph"]
# v5.0.0:自适应查询适配层(接入 sz-orm-adaptive AdaptiveExecutor,提供 adaptive_decide/adaptive_record/adaptive_decision_count 入口)
adaptive-query = ["dep:sz-orm-adaptive"]
# v5.0.0:分布式追踪适配层(接入 sz-orm-tracing SzTracer,提供 tracing_start_span/tracing_end_span/tracing_span_count 入口)
distributed-tracing = ["dep:sz-orm-tracing"]
# v5.0.0 M4:P1 整包接入 core
graphql = ["dep:sz-orm-graphql"]
structured-logging = ["dep:sz-orm-logger"]
postgis = ["dep:sz-orm-postgis"]
timeseries = ["dep:sz-orm-timeseries"]
search = ["dep:sz-orm-search"]
read-write-splitting = ["dep:sz-orm-rw"]
config-center = ["dep:sz-orm-config"]


[dependencies]
async-trait.workspace = true
sea-orm = { version = "1.1", optional = 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锛歅ool 鏃犻攣闃熷垪锛坈rossbeam-queue::ArrayQueue 鏇挎崲 Mutex<VecDeque>锟?
crossbeam-queue.workspace = true
# 娴佸紡鏌ヨ锛欳onnection::query_stream 榛樿瀹炵幇闇€锟?futures::stream::empty
futures.workspace = true
sz-orm-sql-validator = { version = "6.0.0", path = "../sz-orm-sql-validator" }
sz-orm-macros = { version = "6.0.0", path = "../sz-orm-macros" }
# #88 淇锛氬彲閫夋柇璺櫒渚濊禆锛堝惎锟?circuit-breaker feature 鏃剁敓鏁堬級
sz-orm-health = { version = "6.0.0", path = "../sz-orm-health", optional = true }
# #93 淇锛氬彲閫夐檺娴佸櫒渚濊禆锛堝惎锟?rate-limit feature 鏃剁敓鏁堬級
sz-orm-limit = { version = "6.0.0", path = "../sz-orm-limit", optional = true }
# Fix #39锛歀2Cache RedisBackend 鐪熷疄瀹炵幇锛堝惎锟?redis feature 鏃剁敓鏁堬級
# 浣跨敤 connection-manager 鑷姩閲嶈繛 + tokio-comp 寮傛 IO
redis = { workspace = true, optional = true }
# v3.2.0锛氭煡璇㈣鍒掔紦瀛橈紙plan-cache feature锟?
sqlparser = { workspace = true, optional = true }
twox-hash = { workspace = true, optional = true }

# v3.3.0锛氬绉熸埛瀹¤澧炲己锛坢ulti-tenant-enhanced feature锟?
sz-orm-audit = { version = "6.0.0", path = "../sz-orm-audit", optional = true }
# v3.3.0锛氬垪绾ц劚鏁忓寮猴紙multi-tenant-enhanced feature锟?
sz-orm-masking = { version = "6.0.0", path = "../sz-orm-masking", optional = true }
# v3.3.0锛氬垎甯冨紡缂撳瓨甯冮殕杩囨护鍣ㄩ槻鎶わ紙dist-cache feature锟?
# v3.3.0锛氬垎甯冨紡缂撳瓨闅忔満 TTL 闆穿闃叉姢锛坉ist-cache feature锟?
rand = { workspace = true, optional = true }
# v3.3.0锛歐AL 鍔犲瘑锛坉ist-cache feature锟?
sz-orm-crypto = { version = "6.0.0", path = "../sz-orm-crypto", optional = true }
# v3.4.0锛歋mallString 浼樺寲锛坧erf-smallstring feature锟?
compact_str = { workspace = true, optional = true }
# v3.6.0锛歈ueryBuilder 杩佺Щ宸ュ叿锛坬b-migration-tool feature锟?
syn = { version = "2.0", features = ["full", "parsing", "visit"], optional = true }
quote = { version = "1.0", default-features = false, optional = true }
# v3.9.0锛氭暟鎹獙锟?+ 杩佺Щ dry-run + 娴佸紡瀵煎嚭 + benchmark锛坒eature gate 闅旂锟?
regex = { version = "1", optional = true }
csv = { version = "1.3", optional = true }
# v4.1.0锛氭暟鎹?seeding/fixture 绠$悊锛坉ata-seeding feature锛?
serde_yaml = { workspace = true, optional = true }

criterion = { version = "0.5", features = ["html_reports", "async_tokio"], optional = true }
# v4.9.0 TASK-004:异常检测模块(anomaly-detection feature)
sz-orm-anomaly = { version = "6.0.0", path = "../sz-orm-anomaly", optional = true }
# v5.0.0:图数据库适配层(graph feature)
sz-orm-graph = { version = "6.0.0", path = "../sz-orm-graph", optional = true }
# v5.0.0:自适应查询适配层(adaptive-query feature)
sz-orm-adaptive = { version = "6.0.0", path = "../sz-orm-adaptive", optional = true }
# v5.0.0:分布式追踪适配层(distributed-tracing feature)
sz-orm-tracing = { version = "6.0.0", path = "../sz-orm-tracing", optional = true }
# v5.0.0 M4:P1 整包适配层
sz-orm-graphql = { version = "6.0.0", path = "../sz-orm-graphql", optional = true }
sz-orm-logger = { version = "6.0.0", path = "../sz-orm-logger", optional = true }
sz-orm-postgis = { version = "6.0.0", path = "../sz-orm-postgis", optional = true }
sz-orm-timeseries = { version = "6.0.0", path = "../sz-orm-timeseries", optional = true }
sz-orm-search = { version = "6.0.0", path = "../sz-orm-search", optional = true }
sz-orm-rw = { version = "6.0.0", path = "../sz-orm-rw", optional = true }
sz-orm-config = { version = "6.0.0", path = "../sz-orm-config", optional = true }


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


# M3-T3: 宸垎娴嬭瘯闇€锟?sz-orm-query-builder
sz-orm-query-builder = { path = "../sz-orm-query-builder" }
# v4.3.0 M2:N+1 静态检测交叉验证(静态分析 ↔ 运行时 N1QueryDetector)
sz-orm-n1-lint = { path = "../sz-orm-n1-lint", features = ["n1-lint"] }
sqlx = { version = "0.9", default-features = false, features = ["runtime-tokio", "tls-rustls", "mysql", "postgres", "sqlite", "chrono", "json"] }
rusqlite = { version = "0.32", features = ["bundled"] }
# DuckDB 鐪熷疄闆嗘垚娴嬭瘯锛坆undled锛氱紪锟?DuckDB 婧愮爜锛岄渶 MSVC + CMake锟?
duckdb = { version = "1", features = ["bundled"] }
oracle = { version = "0.6", default-features = false, features = ["chrono"] }
# v2.0.0 浠诲姟 1.2锛歋QL Server 鐪熷疄闆嗘垚娴嬭瘯锛坱iberius 0.12 寮傛椹卞姩锟?
# 浠呭惎锟?tds73 + chrono锛屼笉鍚敤 TLS锛堟湰鍦板紑鍙戠幆澧冿紱鐢熶骇鐜搴斿惎锟?rustls 锟?native-tls锟?
tiberius = { version = "0.12", default-features = false, features = ["tds73", "chrono"] }
# tiberius 0.12 闇€锟?tokio-util compat 閫傞厤 tokio TcpStream
tokio-util = { version = "0.7", features = ["compat"] }
criterion = { version = "0.5", features = ["html_reports", "async_tokio"] }
# v0.2.1 淇 T-1锛歅roperty-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"

# v2.0.0 浠诲姟 1.2锛歋QL Server 闆嗘垚娴嬭瘯鍏ュ彛
[[test]]
name = "integration_mssql"
path = "tests/integration_mssql.rs"

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

# v0.2.1 淇 T-1锛歅roperty-Based Testing 鍏ュ彛
[[test]]
name = "property"
path = "tests/property.rs"

# v0.2.1 闃舵鍗佷簲锛歋oak Test 鍏ュ彛锛堥粯锟?ignored锛孋I 24h 浠诲姟杩愯锟?
[[test]]
name = "soak"
path = "tests/soak.rs"

# 杩炴帴姹犳贩娌屽伐绋嬫祴锟?
[[test]]
name = "chaos_pool"
path = "tests/chaos_pool.rs"

# v3.3.0 澶氱鎴风珵鎬佷笌璺ㄧ鎴锋硠婕忔祴锟?
[[test]]
name = "tenant_concurrency"
path = "tests/tenant_concurrency.rs"
required-features = ["multi-tenant-enhanced"]

# F4/F5 变异盲区回归测试(需 multi-tenant-enhanced feature)
[[test]]
name = "tenant_quota_rls_regression"
path = "tests/tenant_quota_rls_regression.rs"
required-features = ["multi-tenant-enhanced"]

# v3.2.0 鏌ヨ璁″垝缂撳瓨宸垎娴嬭瘯锛堥渶 plan-cache feature锟?
[[test]]
name = "plan_cache_differential"
path = "tests/plan_cache_differential.rs"
required-features = ["plan-cache"]

# v3.1.0 SIMD 宸垎娴嬭瘯锛堥渶 simd feature锟?
[[test]]
name = "simd_differential"
path = "tests/simd_differential.rs"
required-features = ["simd"]

# v3.2.0 杩炴帴姹犻鐑泦鎴愭祴璇曪紙闇€ auto-prewarm feature锟?
[[test]]
name = "prewarm_integration"
path = "tests/prewarm_integration.rs"
required-features = ["auto-prewarm"]

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

[[test]]
name = "type_safe_columns"
path = "tests/type_safe_columns.rs"
required-features = ["type-safe-columns"]

# M2: typed_ast DSL 46 绉嶈〃杈惧紡娴嬭瘯锛堥渶 typed-dsl feature锟?
[[test]]
name = "typed_ast_aggregate"
path = "tests/typed_ast_aggregate_test.rs"
required-features = ["typed-dsl"]

[[test]]
name = "typed_ast_arithmetic"
path = "tests/typed_ast_arithmetic_test.rs"
required-features = ["typed-dsl"]

[[test]]
name = "typed_ast_string"
path = "tests/typed_ast_string_test.rs"
required-features = ["typed-dsl"]

[[test]]
name = "typed_ast_date"
path = "tests/typed_ast_date_test.rs"
required-features = ["typed-dsl"]

[[test]]
name = "typed_ast_zst_diff"
path = "tests/typed_ast_zst_diff_test.rs"
required-features = ["typed-dsl"]

# M1-T7: 15 绉嶆柊澧炶〃杈惧紡 ZST 鏂█娴嬭瘯锛堥渶 typed-dsl feature锟?
[[test]]
name = "typed_ast_zst_assert"
path = "tests/typed_ast_zst_assert_test.rs"
required-features = ["typed-dsl"]

# M1-T9: SQL 娉ㄥ叆闃叉姢娴嬭瘯锛堥渶 typed-dsl feature锟?
[[test]]
name = "typed_ast_sql_injection"
path = "tests/typed_ast_sql_injection_test.rs"
required-features = ["typed-dsl"]

# M2: L1 缂撳瓨娴嬭瘯锛堥渶 l1-cache feature锟?
[[test]]
name = "l1_cache"
path = "tests/l1_cache_test.rs"
required-features = ["l1-cache"]

[[test]]
name = "l1_l2_db"
path = "tests/l1_l2_db_test.rs"
required-features = ["l1-cache"]

# M5: CockroachDB 鏂硅█娴嬭瘯锛堥渶 dialect-cockroachdb feature锟?
[[test]]
name = "dialect_cockroachdb"
path = "tests/dialect_cockroachdb_test.rs"
required-features = ["dialect-cockroachdb"]

# M5: YugabyteDB 鏂硅█娴嬭瘯锛堥渶 dialect-yugabytedb feature锟?
[[test]]
name = "dialect_yugabytedb"
path = "tests/dialect_yugabytedb_test.rs"
required-features = ["dialect-yugabytedb"]

# M4: Snowflake 鏂硅█娴嬭瘯锛堥渶 dialect-snowflake feature锟?
[[test]]
name = "dialect_snowflake"
path = "tests/dialect_snowflake_test.rs"
required-features = ["dialect-snowflake"]

# M4: Redshift 鏂硅█娴嬭瘯锛堥渶 dialect-redshift feature锟?
[[test]]
name = "dialect_redshift"
path = "tests/dialect_redshift_test.rs"
required-features = ["dialect-redshift"]

# M3: QueryBuilder 杩佺Щ宸ュ叿娴嬭瘯
[[test]]
name = "qb_migration_lint"
path = "tests/qb_migration_lint_test.rs"
required-features = ["qb-migration-tool"]

[[test]]
name = "qb_migration_fix"
path = "tests/qb_migration_fix_test.rs"
required-features = ["qb-migration-tool"]

[[test]]
name = "qb_migration_diff"
path = "tests/qb_migration_diff_test.rs"
required-features = ["qb-migration-tool"]

# M1: 鐪熷疄 DB e2e 娴嬭瘯濂椾欢锛堥渶 e2e-real-db feature锟?
[[test]]
name = "e2e_real_db_crud"
path = "tests/e2e_real_db_crud.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_transaction"
path = "tests/e2e_real_db_transaction.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_pagination"
path = "tests/e2e_real_db_pagination.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_soft_delete"
path = "tests/e2e_real_db_soft_delete.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_dialect_behavior"
path = "tests/e2e_real_db_dialect_behavior.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_eager_load"
path = "tests/e2e_real_db_eager_load.rs"
required-features = ["e2e-real-db"]

[[test]]
name = "e2e_real_db_multi_tenant"
path = "tests/e2e_real_db_multi_tenant.rs"
required-features = ["e2e-real-db", "multi-tenant-enhanced"]

[[test]]
name = "e2e_real_db_cache"
path = "tests/e2e_real_db_cache.rs"
required-features = ["e2e-real-db", "l1-cache"]

# M3-T1: typed relation 娴嬭瘯锛堥渶 typed-relation feature锟?
[[test]]
name = "typed_relation_test"
path = "tests/typed_relation_test.rs"
required-features = ["typed-relation"]

# M3-T8: proc-macro SQL 楠岃瘉娴嬭瘯锛堥渶 sql-verify-proc feature锟?
[[test]]
name = "sql_verify_proc_test"
path = "tests/sql_verify_proc_test.rs"
required-features = ["sql-verify-proc"]

# M4-T2: Informix 鏂硅█娴嬭瘯锛堥渶 dialect-informix feature锟?
[[test]]
name = "dialect_informix_test"
path = "tests/dialect_informix_test.rs"
required-features = ["dialect-informix"]

# M4-T4: SAP HANA 鏂硅█娴嬭瘯锛堥渶 dialect-saphana feature锟?
[[test]]
name = "dialect_saphana_test"
path = "tests/dialect_saphana_test.rs"
required-features = ["dialect-saphana"]

# M4-T6: Firebird 鏂硅█娴嬭瘯锛堥渶 dialect-firebird feature锟?
[[test]]
name = "dialect_firebird_test"
path = "tests/dialect_firebird_test.rs"
required-features = ["dialect-firebird"]

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

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

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

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

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

# M2: L1 缂撳瓨鎬ц兘鍩哄噯锛堥渶 l1-cache feature锟?
[[bench]]
name = "l1_cache_bench"
path = "benches/l1_cache_bench.rs"
harness = false
required-features = ["l1-cache"]

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

[[bench]]
name = "zero_copy_bench"
path = "benches/zero_copy_bench.rs"
harness = false
required-features = ["zero-copy"]

[[bench]]
name = "simd_bench"
path = "benches/simd_bench.rs"
harness = false
required-features = ["simd"]

# v3.9.0 M2锛氬叚澶ц矾寰勫洖褰掑熀鍑嗗浠讹紙闇€ benchmark-suite feature锟?
[[bench]]
name = "regression_query_build"
path = "benches/regression_query_build.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_pool"
path = "benches/regression_pool.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_pool_steady"
path = "benches/regression_pool_steady.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_cache"
path = "benches/regression_cache.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_transaction"
path = "benches/regression_transaction.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_serialization"
path = "benches/regression_serialization.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_stream"
path = "benches/regression_stream.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_sqlx_alignment"
path = "benches/regression_sqlx_alignment.rs"
harness = false
required-features = ["benchmark-suite"]

[[bench]]
name = "regression_seaorm_alignment"
path = "benches/regression_seaorm_alignment.rs"
harness = false
required-features = ["bench-seaorm"]

# v5.0.0:图数据库适配层端到端测试(需 graph feature)
[[test]]
name = "graph_adapter_e2e"
path = "tests/graph_adapter_e2e.rs"
required-features = ["graph"]

# v5.0.0:自适应查询适配层端到端测试(需 adaptive-query feature)
[[test]]
name = "adaptive_adapter_e2e"
path = "tests/adaptive_adapter_e2e.rs"
required-features = ["adaptive-query"]

# v5.0.0:分布式追踪适配层端到端测试(需 distributed-tracing feature)
[[test]]
name = "tracing_adapter_e2e"
path = "tests/tracing_adapter_e2e.rs"
required-features = ["distributed-tracing"]

# v5.0.0 M4:P1 整包适配层端到端测试
[[test]]
name = "graphql_adapter_e2e"
path = "tests/graphql_adapter_e2e.rs"
required-features = ["graphql"]

[[test]]
name = "logger_adapter_e2e"
path = "tests/logger_adapter_e2e.rs"
required-features = ["structured-logging"]

[[test]]
name = "postgis_adapter_e2e"
path = "tests/postgis_adapter_e2e.rs"
required-features = ["postgis"]

[[test]]
name = "timeseries_adapter_e2e"
path = "tests/timeseries_adapter_e2e.rs"
required-features = ["timeseries"]

[[test]]
name = "search_adapter_e2e"
path = "tests/search_adapter_e2e.rs"
required-features = ["search"]

[[test]]
name = "rw_adapter_e2e"
path = "tests/rw_adapter_e2e.rs"
required-features = ["read-write-splitting"]

[[test]]
name = "config_adapter_e2e"
path = "tests/config_adapter_e2e.rs"
required-features = ["config-center"]


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

[lints]
workspace = true
# v4.7.0 门禁 23:machete 误报登记——以下依赖在 feature 门控内使用
#(circuit-breaker/rate-limit/plan-cache 等 feature 启用时 pool.rs/macros 引用)
[package.metadata.cargo-machete]
ignored = ["sz-orm-health", "sz-orm-limit", "quote"]