// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include "sqlitebasestatement.h" namespace Sqlite { template class WriteStatement : protected StatementImplementation { using Base = StatementImplementation; public: WriteStatement(Utils::SmallStringView sqlStatement, Database &database) : Base(sqlStatement, database) { checkIsWritableStatement(); Base::checkBindingParameterCount(BindParameterCount); Base::checkColumnCount(0); } using Base::database; using Base::execute; using Base::write; protected: void checkIsWritableStatement() { if (Base::isReadOnlyStatement()) throw NotWriteSqlStatement(); } }; } // namespace Sqlite