4
1
mirror of https://github.com/QuasarApp/Heart.git synced 2025-05-12 01:19:42 +00:00

ref sqldbwriter.h grammar correction

This commit is contained in:
Oleg-designer 2021-03-11 15:13:12 +03:00
parent 03168dd0a3
commit 611dfe116b

@ -27,7 +27,7 @@ namespace QH {
/**
* @brief The SqlDBWriter class. This class write and read objects from database (hard level).
* Befor working with database you need to initialize it. The SqlDBWriter support a any sql databases,
* Before working with database you need to initialize it. The SqlDBWriter support a any sql databases,
* For list of supported drivers see the Qt Docummentation https://doc.qt.io/qt-5/sql-driver.html
* For initialize a custom database driver you need to set an own params see the SqlDBWriter::initDb metthod.
* This class work only on single thread. For change working thread use the Qt method moveToThread.
@ -51,7 +51,7 @@ public:
/**
* @brief initDb This method initialize a database params and create a new database if the old database not exists.
* @note this method must be invoked in the some thread as a working thread of this object.
* @param params This is params of initialize a database. For more information about availabe and supported parameters see the description SqlDBWriter::getInitParams method.
* @param params This is params of initialize a database. For more information about available and supported parameters see the description SqlDBWriter::getInitParams method.
* For more information see description of the SqlDBWriter::getInitParams method.
* @return true if database initialize successful.
*/
@ -72,7 +72,7 @@ public:
/**
* @brief databaseLocation This method return location of database.
* If it is sqllite then return path to db file else return database name.
* If it is sqlite then return path to db file else return database name.
* @return path or name of database.
*/
QString databaseLocation() const;
@ -83,9 +83,9 @@ public:
* @brief updateQuery This method execute update query of object.
* For more Information see DBObject::prepareUpdateQuery.
* @param ptr This is strong pointer to object that need to update into a database.
* @param resultOfWork This is bool variable contais result of work a SqlDBWriter::saveObject method.
* @param resultOfWork This is bool variable contains result of work a SqlDBWriter::saveObject method.
* @param endOfWork This wariable set true when the SqlDBWriter::saveObject is finished.
* @return true if function finished seccussful
* @return true if function finished successful
*/
virtual bool updateQuery(const QSharedPointer<QH::PKG::DBObject> &ptr) const;
@ -93,9 +93,9 @@ public:
* @brief selectQuery generate select query to database from parameters.
* @param requestObject This is template object for generate select query.
* @param result This is return values
* @param resultOfWork This is bool variable contais result of work a SqlDBWriter::saveObject method.
* @param endOfWork This wariable set true when the SqlDBWriter::selectQuery is finished.
* @return true if all goodelse false
* @param resultOfWork This is bool variable contains result of work a SqlDBWriter::saveObject method.
* @param endOfWork This variable set true when the SqlDBWriter::selectQuery is finished.
* @return true if all good else false.
*/
virtual bool selectQuery(const QH::PKG::DBObject &requestObject,
QList<QSharedPointer<QH::PKG::DBObject>> &result);
@ -103,8 +103,8 @@ public:
/**
* @brief deleteQuery This method prepare the delete object query.
* @param deleteObject This is tempalte object for generate a delete query.
* @param resultOfWork This is bool variable contais result of work a SqlDBWriter::saveObject method.
* @param endOfWork This wariable set true when the SqlDBWriter::selectQuery is finished.
* @param resultOfWork This is bool variable contains result of work a SqlDBWriter::saveObject method.
* @param endOfWork This variable set true when the SqlDBWriter::selectQuery is finished.
* @return true if query generated successful.
*/
virtual bool deleteQuery(const QSharedPointer<QH::PKG::DBObject> &deleteObject) const;
@ -112,8 +112,8 @@ public:
/**
* @brief insertQuery This method prepare the insert object query.
* @param insertObject This is strong pointer of object for generate the insert query.
* @param resultOfWork This is bool variable contais result of work a SqlDBWriter::saveObject method.
* @param endOfWork This wariable set true when the SqlDBWriter::selectQuery is finished.
* @param resultOfWork This is bool variable contains result of work a SqlDBWriter::saveObject method.
* @param endOfWork This variable set true when the SqlDBWriter::selectQuery is finished.
* @return true if query generated successful.
*/
virtual bool insertQuery(const QSharedPointer<QH::PKG::DBObject>& insertObject) const;
@ -125,14 +125,14 @@ protected slots:
protected:
/**
* @brief enableFK This method enable forign key for the sqlite database
* @return return true if new settings set is correctly
* @brief enableFK This method enable foreign key for the sqlite database.
* @return return true if new settings set is correctly.
*/
bool enableFK();
/**
* @brief disableFK This method disable forign key for the sqlite database
* @return return true if new settings set is correctly
* @brief disableFK This method disable foreign key for the sqlite database.
* @return return true if new settings set is correctly.
*/
bool disableFK();
@ -144,38 +144,38 @@ protected:
* - DBDriver - This is sql driver of data base for more information see The Qt Documentatuons https://doc.qt.io/qt-5/sql-driver.html
* - DBFilePath - This is path to file of data base (sqlite only). This is phusical location of sqlite database.
* - DBInitFile - This is sql file with sql code (structure) with default structure of the database.
* - DBPass - This is password of a remoute databse.
* - DBLogin - This is login of a remoute database.
* - DBHost - This is host addres of a remoute database.
* - DBPort - port of a remoute database.
* - DBPass - This is password of a remote database.
* - DBLogin - This is login of a remote database.
* - DBHost - This is host addres of a remote database.
* - DBPort - port of a remote database.
* @param initFile This is path to json file with database configuration.
* @return The Map with readed configuration. IF file is incorrect or not exists then retun an empty map.
* @return The Map with readed configuration. IF file is incorrect or not exists then return an empty map.
*
*/
virtual QVariantMap getInitParams(const QString& initFile) const;
/**
* @brief defaultInitPararm This method retrun default pdrameters of the database.
* @brief defaultInitPararm This method return default parameters of the database.
* @return map of database params.
*
* * Support parameters of database:
*
* - DBDriver - This is sql driver of data base for more information see The Qt Documentatuons https://doc.qt.io/qt-5/sql-driver.html
* - DBDriver - This is sql driver of data base for more information see The Qt Documentations https://doc.qt.io/qt-5/sql-driver.html
* - DBFilePath - This is path to file of data base (sqlite only). This is phusical location of sqlite database.
* - DBInitFile - This is sql file with sql code (structure) with default structure of the database.
* - DBPass - This is password of a remoute databse.
* - DBLogin - This is login of a remoute database.
* - DBHost - This is host addres of a remoute database.
* - DBPort - port of a remoute database.
* - DBPass - This is password of a remote database.
* - DBLogin - This is login of a remote database.
* - DBHost - This is host address of a remote database.
* - DBPort - port of a remote database.
*/
virtual QVariantMap defaultInitPararm() const;
/**
* @brief initSqlDataBasse This method create ad database connection.
* Without configuratuon. This metho invoked in the initDbPrivate method.
* @note Overrde this method for create f custom method of initialisation of the db connection.
* Without configuration. This method invoked in the initDbPrivate method.
* @note Overrde this method for create f custom method of initialization of the db connection.
* @param driverName This is name of sql driver for more information see about Qt Sql Drivers.
* @param name This is name of path of database.
* @return database object.
@ -186,7 +186,7 @@ protected:
/**
* @brief db This method return db connection. If SqlDBWriter in not inited then return nullptr.
* For more information about initialization the SqlDBWriter see the SqlDBWriter::initDb method.
* @return pointer to actualy databae connection.
* @return pointer to actual database connection.
*/
QSqlDatabase* db();
@ -201,10 +201,10 @@ private:
/**
* @brief workWithQuery - this base function for all prepareQuery functions.
* steps work : call prepareFunc, call exec , call cb.
* @param q - query object with a request
* @param prepareFunc - function with pripare data for query
* @param cb - call after success exec and prepare steps
* @return true if all steps finished successful
* @param q - query object with a request.
* @param prepareFunc - function with prepare data for query.
* @param cb - call after success exec and prepare steps.
* @return true if all steps finished successful.
*/
bool workWithQuery(QSqlQuery &q,
const std::function< PKG::PrepareResult (QSqlQuery &)> &prepareFunc,