Lightweight 0.20261105.1
Loading...
Searching...
No Matches
Lightweight::SqlConnectionString Struct Reference

#include <SqlConnectInfo.hpp>

Public Member Functions

auto operator<=> (SqlConnectionString const &) const noexcept=default
 Three-way comparison operator.
 
LIGHTWEIGHT_API std::string Sanitized () const
 Returns a copy of the connection string with every password value masked, see SanitizePwd.
 

Static Public Member Functions

static LIGHTWEIGHT_API std::string SanitizePwd (std::string_view input)
 

Public Attributes

std::string value
 The raw ODBC connection string value.
 

Detailed Description

Represents an ODBC connection string.

Definition at line 88 of file SqlConnectInfo.hpp.

Member Function Documentation

◆ SanitizePwd()

static LIGHTWEIGHT_API std::string Lightweight::SqlConnectionString::SanitizePwd ( std::string_view  input)
static

Returns a copy of input with the values of its PWD= and Password= attributes replaced by ***, for logging and diagnostics.

The string is parsed attribute-wise following the ODBC quoting rules (see ParseConnectionString()), so a brace-quoted password such as PWD={p;w} is masked as a whole and a ; inside another quoted value does not start a new attribute. Attribute names match case-insensitively and only as a whole (MyPWD= and Database=PasswordVault are left alone); everything that is not a password value, including the spelling of the keys and any whitespace, is copied verbatim.

Parameters
inputThe raw connection string.
Returns
The masked copy.

Member Data Documentation

◆ value

std::string Lightweight::SqlConnectionString::value

The raw ODBC connection string value.

Definition at line 91 of file SqlConnectInfo.hpp.


The documentation for this struct was generated from the following file: