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
//! Connection string parsing and multi-database configuration.
//!
//! This module provides utilities for parsing database connection URLs and
//! managing configurations for multiple database backends.
//!
//! # Supported URL Formats
//!
//! ## PostgreSQL
//! ```text
//! postgres://user:password@host:port/database?options
//! postgresql://user:password@host:port/database?options
//! ```
//!
//! ## MySQL
//! ```text
//! mysql://user:password@host:port/database?options
//! mariadb://user:password@host:port/database?options
//! ```
//!
//! ## SQLite
//! ```text
//! sqlite://path/to/database.db?options
//! sqlite::memory:
//! file:path/to/database.db?options
//! ```
//!
//! # Parsing Connection URLs
//!
//! ```rust
//! use prax_query::ConnectionString;
//!
//! // PostgreSQL URL
//! let conn = ConnectionString::parse("postgres://user:pass@localhost:5432/mydb").unwrap();
//! assert_eq!(conn.host(), Some("localhost"));
//! assert_eq!(conn.port(), Some(5432));
//! assert_eq!(conn.database(), Some("mydb"));
//!
//! // MySQL URL
//! let conn = ConnectionString::parse("mysql://user:pass@localhost:3306/mydb").unwrap();
//!
//! // SQLite URL (note: uses :// prefix)
//! let conn = ConnectionString::parse("sqlite://./data.db").unwrap();
//! ```
//!
//! # Driver Types
//!
//! ```rust
//! use prax_query::Driver;
//!
//! // Default ports
//! assert_eq!(Driver::Postgres.default_port(), Some(5432));
//! assert_eq!(Driver::MySql.default_port(), Some(3306));
//! assert_eq!(Driver::Sqlite.default_port(), None);
//!
//! // Parse from scheme
//! assert_eq!(Driver::from_scheme("postgres").unwrap(), Driver::Postgres);
//! assert_eq!(Driver::from_scheme("postgresql").unwrap(), Driver::Postgres);
//! assert_eq!(Driver::from_scheme("mysql").unwrap(), Driver::MySql);
//! assert_eq!(Driver::from_scheme("mariadb").unwrap(), Driver::MySql);
//! assert_eq!(Driver::from_scheme("sqlite").unwrap(), Driver::Sqlite);
//! ```
//!
//! # SSL Modes
//!
//! ```rust
//! use prax_query::connection::SslMode;
//!
//! // Available SSL modes
//! let mode = SslMode::Disable; // No SSL
//! let mode = SslMode::Prefer; // Use SSL if available
//! let mode = SslMode::Require; // Require SSL
//! let mode = SslMode::VerifyCa; // Verify CA certificate
//! let mode = SslMode::VerifyFull; // Verify CA and hostname
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use PoolConfig;
use Error;
/// Errors that can occur during connection string parsing.
/// Result type for connection operations.
pub type ConnectionResult<T> = ;