#include <DatabaseConnectionEntry.h>
|
| | DatabaseConnectionEntry (std::string_view component, std::string connection, std::string userName, std::string password, db::ConnectionType type, std::string name, int32_t port, std::string databaseName, bool isDefault, int32_t poolSize=-1, int32_t poolAcquireTimeoutMs=-1) |
| |
| const std::string & | getConnection () const |
| |
| const std::string & | getUserName () const |
| |
| const std::string & | getPassword () const |
| |
| const db::ConnectionType & | getType () const |
| |
| const std::string & | getName () const |
| |
| constexpr int32_t | getPort () const |
| |
| const std::string & | getDatabaseName () const |
| |
| constexpr bool | isDefault () const |
| |
| constexpr int32_t | getPoolSize () const |
| |
| constexpr int32_t | getPoolAcquireTimeoutMs () const |
| |
| | Entry (std::string_view component) |
| |
| constexpr std::string_view | getConfigurationParserComponent () const |
| |
Configuration entry for a database connection
◆ DatabaseConnectionEntry()
| lintel::DatabaseConnectionEntry::DatabaseConnectionEntry |
( |
std::string_view |
component, |
|
|
std::string |
connection, |
|
|
std::string |
userName, |
|
|
std::string |
password, |
|
|
db::ConnectionType |
type, |
|
|
std::string |
name, |
|
|
int32_t |
port, |
|
|
std::string |
databaseName, |
|
|
bool |
isDefault, |
|
|
int32_t |
poolSize = -1, |
|
|
int32_t |
poolAcquireTimeoutMs = -1 |
|
) |
| |
Construct a database connection entry
- Parameters
-
| component | The configuration component name |
| connection | The connection string |
| userName | The database user name |
| password | The database password |
| type | The connection type |
| name | The connection name |
| port | The connection port |
| databaseName | The database name |
| isDefault | Whether this is the default connection |
| poolSize | Maximum pooled connections; a negative value selects the type default (PostgreSQL 4, SQLite 1), 0 disables pooling |
| poolAcquireTimeoutMs | Acquire timeout in milliseconds; a negative value selects the default (5000) |
◆ getConnection()
| const std::string & lintel::DatabaseConnectionEntry::getConnection |
( |
| ) |
const |
Get the connection string
- Returns
- The connection string
◆ getDatabaseName()
| const std::string & lintel::DatabaseConnectionEntry::getDatabaseName |
( |
| ) |
const |
Get the database name
- Returns
- The database name
◆ getName()
| const std::string & lintel::DatabaseConnectionEntry::getName |
( |
| ) |
const |
Get the connection name
- Returns
- The name
◆ getPassword()
| const std::string & lintel::DatabaseConnectionEntry::getPassword |
( |
| ) |
const |
Get the database password
- Returns
- The password
◆ getPoolAcquireTimeoutMs()
| constexpr int32_t lintel::DatabaseConnectionEntry::getPoolAcquireTimeoutMs |
( |
| ) |
const |
|
inlineconstexpr |
Get the pool acquire timeout
- Returns
- The acquire timeout in milliseconds
◆ getPoolSize()
Get the maximum number of pooled connections
- Returns
- The pool size; 0 disables pooling
◆ getPort()
Get the connection port
- Returns
- The port number
◆ getType()
Get the connection type
- Returns
- The connection type
◆ getUserName()
| const std::string & lintel::DatabaseConnectionEntry::getUserName |
( |
| ) |
const |
Get the database user name
- Returns
- The user name
◆ isDefault()
| constexpr bool lintel::DatabaseConnectionEntry::isDefault |
( |
| ) |
const |
|
inlineconstexpr |
Check if this is the default connection
- Returns
- True if default
◆ operator<<
Stream insertion operator for database connection entries
- Parameters
-
| os | The output stream |
| entry | The entry to output |
- Returns
- The output stream
◆ kDefaultPoolAcquireTimeoutMs
| constexpr int32_t lintel::DatabaseConnectionEntry::kDefaultPoolAcquireTimeoutMs = 5000 |
|
staticconstexpr |
Default wait time of a pool acquire, in milliseconds.
◆ kDefaultPostgresPoolSize
Default pool size for PostgreSQL connections (parallel HTTP threads).
◆ kDefaultSqlitePoolSize
Default pool size for SQLite connections (a single serialized connection).
The documentation for this class was generated from the following file: