forked from qt-creator/qt-creator
Sqlite: Move result count to class declaration
It move the magic number of column results to the sql statement and improves the mock a little bit. Change-Id: I101067444cf27ec5dea0c72de7fd484a7e8710f0 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -29,17 +29,28 @@
|
||||
|
||||
namespace Sqlite {
|
||||
|
||||
class SQLITE_EXPORT WriteStatement : protected StatementImplementation<BaseStatement>
|
||||
class WriteStatement : protected StatementImplementation<BaseStatement, -1>
|
||||
{
|
||||
public:
|
||||
explicit WriteStatement(Utils::SmallStringView sqlStatement, Database &database);
|
||||
using Base = StatementImplementation<BaseStatement, -1>;
|
||||
|
||||
public:
|
||||
WriteStatement(Utils::SmallStringView sqlStatement, Database &database)
|
||||
: StatementImplementation(sqlStatement, database)
|
||||
{
|
||||
checkIsWritableStatement();
|
||||
}
|
||||
|
||||
using StatementImplementation::execute;
|
||||
using StatementImplementation::database;
|
||||
using StatementImplementation::execute;
|
||||
using StatementImplementation::write;
|
||||
|
||||
protected:
|
||||
void checkIsWritableStatement();
|
||||
void checkIsWritableStatement()
|
||||
{
|
||||
if (Base::isReadOnlyStatement())
|
||||
throw NotWriteSqlStatement(
|
||||
"SqliteStatement::SqliteWriteStatement: is not a writable statement!");
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Sqlite
|
||||
|
||||
Reference in New Issue
Block a user