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
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
//! # SZ-ORM — Xianshida ORM
//!
//! Rust asynchronous ORM workspace (prototype stage), ThinkORM-style compatible.
//!
//! ## Architecture Overview
//!
//! The SZ-ORM workspace consists of **43 members** (41 sz-orm-* libs + cli + examples):
//!
//! ### Core Engine (sz-orm-core)
//! | Module | Function |
//! |------|------|
//! | `model` | `Model` trait — defines table name, primary key, timestamps, soft delete, relations |
//! | `query` | `QueryBuilder<M>` — chainable API, supports SELECT/INSERT/UPDATE/DELETE/aggregation/pagination/JOIN |
//! | `dialect` | Multi-database dialects — MySQL (backtick), PostgreSQL (double quote), SQLite, Oracle 23ai |
//! | `pool` | Asynchronous connection pool — configurable size, timeout, idle reaping, health checks, max lifetime |
//! | `transaction` | ACID transactions — isolation levels, savepoints, `TransactionManager` for multi-transaction management |
//! | `migration` | File-based migration system — up/down/rollback/reset/refresh, with `SchemaBuilder` |
//! | `cache` | Multi-level cache — `MemoryCache`, `MultiLevelCache`, with TTL support |
//! | `value` | Unified value type — 20 variants (integer/float/string/bytes/UUID/date/JSON/array) |
//! | `db_type` | Database type enum — MySQL, PostgreSQL, SQLite, Oracle, Redis, MongoDB and 11 total |
//! | `error` | Error type system — `DbError` (20 variants), `PoolError`, `CacheError`, `TxError` |
//!
//! ### Database Adapters
//! - **sz-orm-sqlx** — sqlx adapter, connects to real MySQL/PostgreSQL/SQLite/Oracle
//! - **sz-orm-sql-validator** — SQL validation and injection detection
//!
//! ### Extension Ecosystem Packages (18)
//! | Package | Function |
//! |------|------|
//! | sz-orm-crypto | Crypto primitives (AES-256-GCM, PBKDF2, HMAC-SHA256) |
//! | sz-orm-auth | JWT authentication (HS256) |
//! | sz-orm-scheduler | Cron scheduled task dispatch |
//! | sz-orm-mqtt | MQTT client (rumqttc) |
//! | sz-orm-websocket | WebSocket server (tokio-tungstenite) |
//! | sz-orm-queue | Message queue (RabbitMQ/lapin, Kafka, NATS, ActiveMQ, RocketMQ, Pulsar) |
//! | sz-orm-storage | Object storage (S3/Alibaba Cloud/Tencent Cloud/Huawei Cloud/Qiniu/Upyun/Local) |
//! | sz-orm-ai | AI integration (Embedding, RAG, Vector) |
//! | sz-orm-grpc | gRPC server/client |
//! | sz-orm-graphql | GraphQL query support |
//! | sz-orm-es | Elasticsearch integration |
//! | sz-orm-tracing | Distributed tracing |
//! | sz-orm-logger | Logging system |
//! | sz-orm-swagger | API documentation generation |
//! | sz-orm-masking | Data masking |
//! | sz-orm-health | Health checks |
//! | sz-orm-audit | Audit log |
//! | sz-orm-batch | Batch operations |
//!
//! ### Advanced Feature Packages (6)
//! | Package | Function |
//! |------|------|
//! | sz-orm-dtx | Distributed transactions |
//! | sz-orm-rw | Read-write splitting |
//! | sz-orm-sharding | Sharding |
//! | sz-orm-limit | Rate limiting |
//! | sz-orm-config | Configuration management |
//! | sz-orm-mig | Enhanced migration management |
//!
//! ### Platform Support
//! - **sz-orm-wasm** — WebAssembly compile target
//! - **sz-orm-lc** — Local/edge computing
//! - **sz-orm-back** — Backup and restore
//!
//! ## Quick Start
//!
//! ```rust,ignore
//! use sz_orm_core::*;
//!
//! // 1. Define the model
//! #[derive(Clone)]
//! struct User {
//! id: i64,
//! name: String,
//! email: String,
//! }
//!
//! impl Model for User {
//! type PrimaryKey = i64;
//! fn table_name() -> &'static str { "users" }
//! fn pk(&self) -> Self::PrimaryKey { self.id }
//! fn set_pk(&mut self, pk: Self::PrimaryKey) { self.id = pk; }
//! }
//!
//! // 2. Build a query
//! let dialect = get_dialect(DbType::MySQL).unwrap();
//! let sql = QueryBuilder::<User>::new(dialect)
//! .table("users")
//! .select(vec!["id", "name", "email"])
//! .where_eq("status", Value::String("active".to_string()))
//! .order_by("created_at")
//! .order_desc("id")
//! .limit(10)
//! .build_select();
//!
//! // 3. Validate before execution
//! QueryBuilder::<User>::new(get_dialect(DbType::MySQL).unwrap())
//! .table("users")
//! .select(vec!["id", "name"])
//! .validate()?; // Validate SQL syntax, injection, parenthesis balance
//!
//! // 4. Other operations
//! let mut data = std::collections::HashMap::new();
//! data.insert("name".to_string(), Value::String("Alice".to_string()));
//! data.insert("age".to_string(), Value::I64(25));
//!
//! let insert_sql = QueryBuilder::<User>::new(dialect)
//! .table("users")
//! .build_insert(&data);
//!
//! let update_sql = QueryBuilder::<User>::new(get_dialect(DbType::MySQL).unwrap())
//! .table("users")
//! .where_eq("id", Value::I64(1))
//! .build_update(&data);
//!
//! let delete_sql = QueryBuilder::<User>::new(get_dialect(DbType::MySQL).unwrap())
//! .table("users")
//! .where_eq("id", Value::I64(1))
//! .build_delete();
//! ```
//!
//! ## Supported Databases
//!
//! | Database | Dialect Implementation | Real Connection | Quoting |
//! |--------|---------|---------|---------|
//! | MySQL | `MySqlDialect` (`` ` `` backtick) | sz-orm-sqlx | ✅ |
//! | PostgreSQL | `PostgreSqlDialect` (`"` double quote) | sz-orm-sqlx | ✅ |
//! | SQLite 3.35+ | `SqliteDialect` (`"` double quote) | sz-orm-sqlx | ✅ |
//! | Oracle 23ai | `OracleDialect` (automatic type mapping) | sz-orm-sqlx | ✅ |
//!
//! Obtain a dialect instance via `get_dialect(DbType::MySQL)`. Each dialect handles:
//! - Identifier quoting style
//! - String escaping rules
//! - Pagination syntax (LIMIT/OFFSET vs OFFSET/FETCH)
//! - JSON extraction functions (JSON_EXTRACT vs #>> vs json_extract vs JSON_VALUE)
//! - Full-text search (MATCH AGAINST vs to_tsvector vs CONTAINS)
//! - Boolean-to-integer conversion (IF/CASE)
//! - Auto-increment keyword (AUTO_INCREMENT/GENERATED BY DEFAULT AS IDENTITY)
//!
//! ## Core Features in Detail
//!
//! ### QueryBuilder API
//!
//! Most query methods return `Self`, enabling chainable calls; validation methods like `select`/`having`
//! return `Result<Self>` (after audit M-5/M-6, column names/aggregate expressions go through identifier validation):
//!
//! ```rust,ignore
//! // Basic query
//! QueryBuilder::<M>::new(dialect)
//! .table("users")
//! .select(vec!["id", "name"])? // Column validation + quote
//! .where_eq("status", Value::String("active".to_string())) // AND
//! .or_where_eq("role", Value::String("admin".to_string())) // OR
//! .where_in("id", vec![Value::I64(1), Value::I64(2)])
//! .where_between("age", Value::I64(18), Value::I64(30))
//! .where_null("deleted_at")
//! .order_by("created_at")
//! .order_desc("id")
//! .group_by("status")
//! .having(AggExpr::CountStar, HavingOp::Gt, Value::I64(5))? // Parameterized HAVING
//! .limit(20)
//! .offset(40)
//! .page(3, 20) // page=3, page_size=20
//! .join_inner("posts", "users.id", "posts.user_id")
//! .join_left("profiles", "users.id", "profiles.user_id")
//! .build_select();
//!
//! // Aggregate functions
//! builder.build_count(); // SELECT COUNT(*)
//! builder.build_exists(); // SELECT EXISTS(...)
//! builder.build_max("score");
//! builder.build_min("price");
//! builder.build_sum("amount");
//! builder.build_avg("value");
//! ```
//!
//! ### SQL Validation
//!
//! ```rust,ignore
//! // Compile-time + runtime dual validation
//! builder.validate()?; // Validate SELECT
//! builder.validate_insert(&data)?; // Validate INSERT (including empty data check)
//! builder.validate_update(&data)?; // Validate UPDATE (including empty data check)
//! builder.validate_delete()?; // Validate DELETE
//!
//! // Validation covers: SQL syntax, injection detection, parenthesis balance,
//! // table/column name legitimacy, JOIN column validation
//! ```
//!
//! ### Model Trait
//!
//! ```rust,ignore
//! pub trait Model: Send + Sync + Sized + 'static {
//! type PrimaryKey: Send + Sync + Debug + Display + Clone + Default;
//!
//! fn table_name() -> &'static str; // Table name (required)
//! fn pk_name() -> &'static str { "id" } // Primary key column name
//! fn pk(&self) -> Self::PrimaryKey; // Get primary key value
//! fn set_pk(&mut self, pk: Self::PrimaryKey); // Set primary key value
//! fn foreign_key(relation: &str) -> String; // Foreign key naming "user_id"
//! fn timestamp_fields() -> Option<TimestampFields>; // Automatic timestamps
//! fn soft_delete_field() -> Option<&'static str>; // Soft delete field
//! }
//!
//! // ModelExt extension
//! pub trait ModelExt: Model {
//! fn columns() -> Vec<&'static str>; // All columns
//! fn fillable() -> Vec<&'static str>; // Fillable columns
//! fn guarded() -> Vec<&'static str>; // Guarded columns (includes primary key by default)
//! fn hidden() -> Vec<&'static str>; // Hidden columns (not serialized)
//! fn relations() -> HashMap<&str, Relation>; // Relations
//! fn fill(&mut self, data: HashMap<String, Value>); // Mass assignment
//! fn to_json(&self) -> serde_json::Value; // Serialize
//! }
//!
//! // Four relation types
//! // BelongsTo — many-to-one (Order → User)
//! // HasMany — one-to-many (User → Orders)
//! // HasOne — one-to-one (User → Profile)
//! // BelongsToMany — many-to-many (User ↔ Role, through junction table)
//! ```
//!
//! ### Connection Pool
//!
//! ```rust,ignore
//! // Configure via Builder
//! let config = PoolConfigBuilder::new()
//! .max_size(100) // Maximum connections
//! .min_idle(10) // Minimum idle connections
//! .acquire_timeout(30) // Acquire timeout (seconds)
//! .idle_timeout(600) // Idle timeout (seconds)
//! .max_lifetime(1800) // Max lifetime (seconds)
//! .build()?;
//!
//! let pool = Pool::new(config, factory)?;
//! let conn = pool.acquire().await?; // Acquire connection (with timeout)
//! pool.release(conn).await; // Release connection
//! pool.status().await; // PoolStatus { idle, active, max, min }
//! pool.reap_idle().await; // Reap idle connections
//! pool.close_all().await; // Close all connections
//! ```
//!
//! ### Transactions
//!
//! ```rust,ignore
//! // Transaction options
//! let opts = TransactOptions::default()
//! .with_isolation(IsolationLevel::Serializable)
//! .read_only()
//! .with_timeout(Duration::from_secs(30));
//!
//! let mut tx = Transaction::new(conn, opts);
//! tx.execute("INSERT INTO users VALUES (1)").await?;
//! tx.query("SELECT * FROM users").await?;
//!
//! // Savepoints (nested transactions)
//! let sp = tx.savepoint().await?; // SAVEPOINT sp_N
//! tx.rollback_to_savepoint(&sp).await?; // ROLLBACK TO SAVEPOINT sp_N
//! tx.release_savepoint(&sp).await?; // RELEASE SAVEPOINT sp_N
//!
//! tx.commit().await?;
//! // tx.rollback().await?;
//!
//! // TransactionManager: manages multiple named transactions
//! let mgr = TransactionManager::new();
//! mgr.begin("tx1", conn, opts).await?;
//! mgr.commit("tx1").await?;
//! mgr.list().await; // ["tx1"]
//! mgr.state("tx1").await; // Some(TransactionState::Committed)
//! ```
//!
//! ### Migration System
//!
//! ```rust,ignore
//! // File naming: <version>_<name>_up.sql / <version>_<name>_down.sql
//! // Example: 001_create_users_up.sql, 001_create_users_down.sql
//!
//! let resolver = FileMigrationResolver::new(PathBuf::from("./migrations"));
//! let migrations = resolver.resolve(DbType::MySQL)?;
//!
//! let mut migrator = Migrator::new(MigrationContext::default())
//! .add_migrations(migrations);
//!
//! migrator.migrate().await?; // Execute all pending migrations
//! migrator.up(Some("003")).await?; // Migrate up to specified version
//! migrator.down(Some("001")).await?; // Rollback to specified version
//! migrator.rollback("002").await?; // Rollback a single migration
//! migrator.reset().await?; // Rollback all + re-execute
//! migrator.refresh().await?; // Same as reset
//! migrator.progress(); // MigrationProgress { total, applied, pending }
//!
//! // SchemaBuilder: programmatic table creation
//! let sql = SchemaBuilder::new("users")
//! .add_column(ColumnDef::new("id", "INT").not_null().auto_increment())
//! .add_column(ColumnDef::new("name", "VARCHAR").length(255).not_null())
//! .add_index(IndexDef::new("idx_name", vec!["name"]).unique())
//! .add_foreign_key(
//! ForeignKeyDef::new("fk_role", "role_id", "roles", "id")
//! .on_delete("CASCADE")
//! )
//! .build(DbType::MySQL);
//! ```
//!
//! ### Value Type
//!
//! ```rust,ignore
//! // 20 variants, covering all database types
//! Value::Null | Bool(bool) | I8..I64 | U8..U64 | F32 | F64
//! | String(String) | Bytes(Vec<u8>) | Uuid(String) | Date(String)
//! | DateTime(String) | Time(String) | Json(String) | Array(Vec<Value>)
//!
//! // Type conversions
//! value.as_str() // Option<&str>
//! value.as_i64() // Option<i64> (supports F32/F64/Bool/String→i64 conversion)
//! value.as_f64() // Option<f64>
//! value.as_bool() // Option<bool> (supports "true"/"1"/"yes"/"on" etc.)
//! value.as_bytes() // Option<&[u8]>
//! value.to_param() // Cow<str> — SQL parameter format
//!
//! // From implementations
//! let v: Value = 42i64.into();
//! let v: Value = "hello".into();
//! let v: Value = vec![1u8, 2u8].into();
//! ```
//!
//! ## Error Handling
//!
//! Unified error type system, each error carries a unique error code:
//!
//! ```rust,ignore
//! // DbError — 20 variants, error codes DB001-DB020
//! DbError::QueryError("...")
//! DbError::ConnectionRefused("...")
//! DbError::ConnectionTimeout("...")
//! DbError::NotFound("...")
//! DbError::ConstraintViolation("...")
//! // ... etc.
//!
//! // PoolError — 6 variants, error codes PL001-PL006
//! PoolError::Exhausted | Timeout | AlreadyAcquired | InvalidConfig | ...
//!
//! // CacheError — 6 variants, error codes CH001-CH006
//! // TxError — 6 variants (NotStarted, CommitFailed, SavepointError, etc.)
//!
//! // Convenience methods
//! DbError::query("test failed") // Create query error
//! DbError::connection("timeout") // Create connection error
//! DbError::not_found("user #42") // Create not-found error
//! err.is_retryable() // Whether retryable
//! err.error_code() // "DB001"
//! ```
//!
//! ## Validation Methods
//!
//! SZ-ORM ensures quality through a **7-layer validation system**:
//!
//! | Method | Description | Test File |
//! |---------|------|---------|
//! | **TDD** | 115+ unit tests for core modules | `core.rs` |
//! | **Integration** | End-to-end with real MySQL/PG/SQLite/Oracle | `integration_mysql.rs`, `integration_pg.rs`, `integration_sqlite.rs` |
//! | **Jepsen** | 29 concurrency correctness tests + 10 real DB Jepsen | `jepsen.rs`, `real_db_jepsen.rs` |
//! | **Fuzz** | 11 boundary/edge case discoveries | `fuzz.rs` |
//! | **Stress** | 77 performance benchmarks | `stress.rs`, `core_bench.rs` |
//! | **Chaos** | 16 fault robustness tests | `chaos.rs` |
//! | **Formal** | 14 formal verification invariants | `formal.rs` |
//!
//! **Total: 1,723 tests** (1,317 `#[test]` + 406 `#[tokio::test]`; some require real services)
//!
//! ## Type Aliases and Constants
//!
//! ```rust,ignore
//! // Type aliases
//! pub type Shared<T> = Arc<T>;
//! pub type Boxed<T> = Box<T>;
//! pub type DbResult<T> = Result<T, DbError>;
//! pub type PoolResult<T> = Result<T, PoolError>;
//! pub type CacheResult<T> = Result<T, CacheError>;
//! pub type TxResult<T> = Result<T, TxError>;
//!
//! // Default constants
//! pub const DEFAULT_BATCH_SIZE: usize = 1000;
//! pub const DEFAULT_ACQUIRE_TIMEOUT: u64 = 30; // seconds
//! pub const DEFAULT_IDLE_TIMEOUT: u64 = 600; // seconds
//! pub const DEFAULT_MAX_LIFETIME: u64 = 1800; // seconds
//! pub const DEFAULT_MIN_IDLE: u32 = 5;
//! pub const DEFAULT_MAX_SIZE: u32 = 100;
//! ```
//!
//! ## Export Manifest
//!
//! `use sz_orm_core::*;` imports all public symbols from the following modules:
//!
//! - `async_trait` (re-exported), `bytes::Bytes`, `chrono::{DateTime, Utc}`, `serde::{Deserialize, Serialize}`
//! - `cache::*` — `Cache`, `MemoryCache`, `MultiLevelCache`, `CacheStats`
//! - `db_type::*` — `DbType` enum (11 database types)
//! - `dialect::*` — `Dialect`, `MySqlDialect`, `PostgreSqlDialect`, `SqliteDialect`, `OracleDialect`, `get_dialect()`
//! - `error::*` — `DbError`, `PoolError`, `CacheError`, `TxError`
//! - `migration::*` — `Migration`, `Migrator`, `SchemaBuilder`, `ColumnDef`, `IndexDef`, `ForeignKeyDef`
//! - `model::*` — `Model`, `ModelExt`, `Relation`, `BelongsTo`, `HasMany`, `HasOne`, `BelongsToMany`
//! - `pool::*` — `Pool`, `PoolConfig`, `PoolConfigBuilder`, `Connection`, `ConnectionFactory`, `PoolStatus`
//! - `query::*` — `QueryBuilder<M>` (chainable SQL builder)
//! - `transaction::*` — `Transaction`, `TransactionManager`, `TransactOptions`, `IsolationLevel`
//! - `value::*` — `Value` enum (20 variants)
// 文档完整性:全局启用 missing_docs lint(v3.6.0 已补齐全部 pub API 文档)
// v3.9.0 M1-T3:derive(Validate) 宏生成 sz_orm_core 绝对路径,
// crate 内部测试需 self 别名使该路径解析到当前 crate
extern crate self as sz_orm_core;
use Arc;
/// Re-export async traits
pub use async_trait;
/// Re-export common types
pub use Bytes;
pub use ;
pub use ;
/// Re-export QueryBuilder for external use
pub use QueryBuilder;
// Re-export proc macros
pub use Query;
pub use QueryAs;
pub use migrate;
pub use query;
pub use query_as;
pub use schema;
pub use sql_string;
pub use typed_query;
// FromQueryResult derive 宏(与 value.rs 中同名 trait 通过显式 use 遮蔽 glob 导出)
pub use detect_n_plus_one;
pub use FromQueryResult;
pub use RelationTrait;
pub use Validate;
pub use ;
pub use ;
pub use LinqQuery;
pub use ;
pub use *;
pub use ;
pub use *;
pub use *;
pub use NestedEagerResult;
pub use *;
pub use *;
pub use *;
pub use CascadeStrategy;
pub use *;
pub use *;
pub use ;
pub use *;
pub use *;
/// Alias for `Arc<T>`
pub type Shared<T> = ;
/// Alias for `Box<T>`
pub type Boxed<T> = ;
/// Alias for Result<T, DbError>
pub type DbResult<T> = ;
/// Result type for pool operations
pub type PoolResult<T> = ;
/// Result type for cache operations
pub type CacheResult<T> = ;
/// Result type for transaction operations
pub type TxResult<T> = ;
/// Default batch size for bulk operations
pub const DEFAULT_BATCH_SIZE: usize = 1000;
/// Default connection timeout in seconds
pub const DEFAULT_ACQUIRE_TIMEOUT: u64 = 30;
/// Default idle timeout in seconds
pub const DEFAULT_IDLE_TIMEOUT: u64 = 600;
/// Default max lifetime in seconds
pub const DEFAULT_MAX_LIFETIME: u64 = 1800;
/// Default minimum idle connections
pub const DEFAULT_MIN_IDLE: u32 = 5;
/// Default maximum pool size
pub const DEFAULT_MAX_SIZE: u32 = 100;