pub struct DatabaseCredentials {
pub username: Option<String>,
pub password: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub database: Option<String>,
pub extra_params: HashMap<String, String>,
}Expand description
Database credentials management with environment variable support
Fields§
§username: Option<String>Database username
password: Option<String>Database password
host: Option<String>Database host
port: Option<u16>Database port
database: Option<String>Database name
extra_params: HashMap<String, String>Additional connection parameters
Implementations§
Source§impl DatabaseCredentials
impl DatabaseCredentials
Sourcepub fn new() -> DatabaseCredentials
pub fn new() -> DatabaseCredentials
Create empty credentials
Sourcepub fn from_environment(database_type: &str) -> DatabaseCredentials
pub fn from_environment(database_type: &str) -> DatabaseCredentials
Load credentials from environment variables
Sourcepub fn apply_to_connection_string(&self, connection_string: &str) -> String
pub fn apply_to_connection_string(&self, connection_string: &str) -> String
Apply credentials to connection string
Sourcepub fn validate(&self, database_type: &str) -> Result<(), DataProfilerError>
pub fn validate(&self, database_type: &str) -> Result<(), DataProfilerError>
Validate that required credentials are present
Sourcepub fn to_masked_string(&self) -> String
pub fn to_masked_string(&self) -> String
Get a masked version for logging (passwords hidden)
Trait Implementations§
Source§impl Clone for DatabaseCredentials
impl Clone for DatabaseCredentials
Source§fn clone(&self) -> DatabaseCredentials
fn clone(&self) -> DatabaseCredentials
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 moreSource§impl Debug for DatabaseCredentials
impl Debug for DatabaseCredentials
Source§impl Default for DatabaseCredentials
impl Default for DatabaseCredentials
Source§fn default() -> DatabaseCredentials
fn default() -> DatabaseCredentials
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DatabaseCredentials
impl RefUnwindSafe for DatabaseCredentials
impl Send for DatabaseCredentials
impl Sync for DatabaseCredentials
impl Unpin for DatabaseCredentials
impl UnsafeUnpin for DatabaseCredentials
impl UnwindSafe for DatabaseCredentials
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more