1. Início
  2. Docs
  3. DBManager
  4. Cabeçalho

Cabeçalho

O cabeçalho da biblioteca DBManager possui duas diferentes classes com seus respectivos métodos, além de um enumerador auxiliar, que realizam o serviço prometido.

  • DBData: Classe auxiliar que ajuda a configurar a conexão ao banco de dados.
  • DBManager: Classe singleton que gerencia uma conexão única da aplicação com o banco de dados.
  • DBConnectionType: Enumerador utilizado para especificar o tipo de banco de dados ao qual a aplicação se conectará.

DBData

Retorno Nome do método
DBData DBData()
void setHostName(const QString &host)
void setDatabaseName(const QString &name)
void setUserName(const QString &name)
void setPassword(const QString &password)
void setConnectionName(const QString &cName)
void setConnectOptions(const QString &options)
void setTablePrefix(const QString &prefix)
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy precisionPolicy)
void setDatabaseConnectionType(DBConnectionType type)
void setPort(int port)
QString hostName()
QString databaseName()
QString username()
QString password()
QString connectionName()
QString connectOptions()
QString tablePrefix()
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy()
DBConnectionType connectionType()
int port()

DBManager

Métodos estáticos

Retorno Nome do método
DBManager * getInstance(const DBData &data = DBData())
QVariant pixmapToVariant(const QPixmap &pixmap)
QPixmap variantToPixmap(const QVariant &variant)
QString getUniqueConnectionName(const QString &partname = "")

Métodos de classe

Retorno Nome do método
bool removeInstance()
bool createTable(const QString &tableName, const QStringList &columns)
bool insertRow(const QString &tableName, const QStringList &columnName, const QVariantList &data)
bool updateRow(const QString &tableName, const QString &columnNameCond, const QVariant &condition, const QStringList &columnName, const QVariantList &data, const QString &operation = "=")
bool updateRow(const QString &tableName, const QStringList &columnNameCond, const QVariantList &condition, const QStringList &columnName, const QVariantList &data, const QString &operation = "=")
bool removeRow(const QString &tableName, const QString &columnNameCond, const QVariant &condition, const QString &operation = "=")
bool removeRow(const QString &tableName, const QStringList &columnNameCond, const QVariantList &condition, const QString &operation = "=")
bool rowExists(const QString &tableName, const QString &columnNameCond, const QVariant &data, const QString &operation = "=")
bool rowExists(const QString &tableName, const QStringList &columnNameCond, const QVariantList &data, const QString &operation = "=")
QVariantList retrieveRow(const QString &tableName, const QString &columnNameCond, const QVariant &condition, const QString &operation = "=")
QVariantList retrieveRow(const QString &tableName, const QStringList &columnNameCond, const QVariantList &condition, const QString &operation = "=")
QVariantList retrieveRow(const QString &tableName, const QStringList &columnNameCond, const QVariantList &condition, QStringList columnName, const QString &operation = "=")
QList< QVariantList > retrieveAll(const QString &tableName, const QStringList &columns = QStringList(), const QStringList &groupby = QStringList(), const QStringList &orderby = QStringList())
QList< QVariantList > retrieveAllCond(const QString &tableName, const QString &columnCondition, const QVariant &condition, const QString &operation = "=", const QStringList &orderby = QStringList())
QList< QVariantList > retrieveAllCond(const QString &tableName, const QStringList &columnCondition, const QVariantList &condition, const QString &operation = "=", const QStringList &orderby = QStringList())
QList< QVariantList > retrieveAllCond(const QString &tableName, const QStringList &columnName, const QString &columnCondition, const QVariant &condition, const QString &operation = "=", const QStringList &groupby = QStringList(), const QStringList &orderby = QStringList())
QList< QVariantList > retrieveAllCond(const QString &tableName, const QStringList &columnName, const QStringList &columnCondition, const QVariantList &condition, const QString &operation = "=", const QStringList &groupby = QStringList(), const QStringList &orderby = QStringList())
int rowsCount(const QString &tableName)
int rowsCountCond(const QString &tableName, const QString &columnCondition, const QVariant &condition, const QString &operation = "=")
int rowsCountCond(const QString &tableName, const QStringList &columnCondition, const QVariantList &condition, const QString &operation = "=")
bool clearTable(const QString &tableName)
bool dropTable(const QString &tableName)
QSqlQuery createCustomQuery(const QString &query = "")
bool setConnectionType(DBConnectionType cType)
DBConnectionType connectionType()
bool setConnectionName(const QString &cName)
QString currentConnectionName()
bool setDBPrefix(const QString &prefix)
QString dbPrefix()
bool setDatabaseData(const DBManager::DBData &dbData)
DBManager::DBData databaseData()

DBConnectionType


Artigos