Inherits istd::IChangeable.
|
| virtual QString | GetHost () const =0 |
| | Gets the database server hostname or IP address.
|
| |
| virtual void | SetHost (const QString &host)=0 |
| | Sets the database server hostname or IP address.
|
| |
| virtual int | GetPort () const =0 |
| | Gets the database server port number.
|
| |
| virtual void | SetPort (int port)=0 |
| | Sets the database server port number.
|
| |
| virtual QString | GetDatabaseName () const =0 |
| | Gets the name of the database to connect to.
|
| |
| virtual void | SetDatabaseName (const QString &databaseName)=0 |
| | Sets the name of the database to connect to.
|
| |
| virtual QString | GetDatabasePath () const =0 |
| | Gets the file system path for file-based databases.
|
| |
| virtual void | SetDatabasePath (const QString &databasePath)=0 |
| | Sets the file system path for file-based databases.
|
| |
| virtual QString | GetUserName () const =0 |
| | Gets the database authentication username.
|
| |
| virtual void | SetUserName (const QString &userName)=0 |
| | Sets the database authentication username.
|
| |
| virtual QString | GetPassword () const =0 |
| | Gets the database authentication password.
|
| |
| virtual void | SetPassword (const QString &password)=0 |
| | Sets the database authentication password.
|
| |
| virtual int | GetConnectionFlags () const =0 |
| | Gets the connection option flags.
|
| |
| virtual void | SetConnectionFlags (int connectionFlags)=0 |
| | Sets the connection option flags.
|
| |
Configuration interface for database connection credentials and parameters.
IDatabaseLoginSettings encapsulates all information required to establish a database connection, including host, port, database name, credentials, and connection options.
Connection Types
The interface supports multiple database types:
Remote Server Databases (PostgreSQL, MySQL):
- Host/Port: Server address and port number
- DatabaseName: Specific database on the server
- UserName/Password: Authentication credentials
- ConnectionFlags: SSL/TLS options
File-Based Databases (SQLite):
- DatabasePath: File system path to database file
- DatabaseName: May be used as connection identifier
- UserName/Password: Typically unused
Security Options
ConnectionOptionFlags control security features:
- COF_SSL: Enable SSL/TLS encryption for network connections
- COF_NO_SECURITY: Disable security (development/testing only)
Usage Example
auto settings = acf::CreateComponent<CDatabaseAccessSettingsComp>();
settings->SetHost("db.example.com");
settings->SetPort(5432);
settings->SetDatabaseName("production_db");
settings->SetUserName("app_user");
settings->SetPassword("secure_password");
auto sqliteSettings = acf::CreateComponent<CDatabaseAccessSettingsComp>();
sqliteSettings->SetDatabasePath("/var/data/app.sqlite");
sqliteSettings->SetDatabaseName("app_db");
@ COF_SSL
Enable SSL/TLS encrypted connection.
- Warning
- Store passwords securely - never hardcode or commit to source control
- Note
- Settings implement IChangeable to notify observers of configuration changes
- See also
- CDatabaseAccessSettings for implementation
-
IDatabaseConnector for usage in connection establishment
Definition at line 70 of file IDatabaseLoginSettings.h.