pub struct ConnectionInfo {
pub scheme: String,
pub host: Option<String>,
pub port: Option<u16>,
pub username: Option<String>,
pub password: Option<String>,
pub database: Option<String>,
pub path: Option<String>,
pub query_params: HashMap<String, String>,
}Expand description
Parse database connection string and extract components
Fields§
§scheme: String§host: Option<String>§port: Option<u16>§username: Option<String>§password: Option<String>§database: Option<String>§path: Option<String>§query_params: HashMap<String, String>Implementations§
Source§impl ConnectionInfo
impl ConnectionInfo
Sourcepub fn parse(connection_string: &str) -> Result<Self, DataProfilerError>
pub fn parse(connection_string: &str) -> Result<Self, DataProfilerError>
Parse a connection string into its components
Sourcepub fn database_type(&self) -> &str
pub fn database_type(&self) -> &str
Get the database type from the scheme
Sourcepub fn to_connection_string(&self, target_format: &str) -> String
pub fn to_connection_string(&self, target_format: &str) -> String
Build a connection string for specific database libraries
Sourcepub fn to_original_string(&self) -> String
pub fn to_original_string(&self) -> String
Reconstruct the original connection string
Trait Implementations§
Source§impl Clone for ConnectionInfo
impl Clone for ConnectionInfo
Source§fn clone(&self) -> ConnectionInfo
fn clone(&self) -> ConnectionInfo
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionInfo
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnsafeUnpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more