8#ifndef DATABASECREDENTIALS_H
9#define DATABASECREDENTIALS_H
39 QString
host()
const {
return _host; }
43 void setHost(
const QString& value) { _host = value; }
48 QString
schema()
const {
return _schema; }
52 void setSchema(
const QString& value) { _schema = value; }
75 QString
engine()
const {
return _engine; }
79 void setEngine(
const QString& value) { _engine = value; }
88 bool isValid()
const {
return _schema.isEmpty() ==
false; }
QString username() const
Get the database username.
bool isValid() const
Return true if the credentials have a non-empty schema.
void setPassword(const QString &value)
Set the database password.
bool isSqlite() const
Return true if the engine is SQLite.
void setEngine(const QString &value)
Set the database engine identifier.
QString password() const
Get the database password.
static const QString SQLENG_PGSQL
Engine identifier string for PostgreSQL.
QString schema() const
Get the database/schema name.
QString engine() const
Get the database engine identifier.
DatabaseCredentials(const QString &host, const QString &schema, const QString &username, const QString &password, const QString &engine)
Construct credentials with all connection parameters.
DatabaseCredentials(const QString &schema)
Construct SQLite credentials with only a schema (file path).
void setHost(const QString &value)
Set the database server hostname.
DatabaseCredentials()
Construct default (empty) credentials.
void setUsername(const QString &value)
Set the database username.
void setSchema(const QString &value)
Set the database/schema name.
static const QString SQLENG_SQLITE
Engine identifier string for SQLite.
QString host() const
Get the database server hostname.
static const QString SQLENG_MYSQL
Engine identifier string for MySQL.