35#include <sptk5/db/DatabaseField.h>
36#include <sptk5/db/DatabaseStatement.h>
42class MySQLStatementField;
147 std::vector<MYSQL_BIND> m_paramBuffers;
148 std::vector<unsigned long> m_paramLengths;
149 std::vector<MYSQL_BIND> m_fieldBuffers;
150 std::shared_ptr<MYSQL_STMT> m_stmt;
151 std::shared_ptr<MYSQL_RES> m_result {
nullptr};
158 void readUnpreparedResultRow(FieldList& fields)
const;
164 void readPreparedResultRow(FieldList& fields);
172 static void decodeMySQLTime(Field* _field,
const MYSQL_TIME& mysqlTime,
VariantDataType fieldType);
180 static void decodeMySQLFloat(Field* _field, MYSQL_BIND& bind);
182 [[noreturn]]
void throwMySQLError()
const
184 throw DatabaseException(mysql_stmt_error(statement()));
187 [[nodiscard]]
bool bindVarCharField(MYSQL_BIND& bind, MySQLStatementField* field,
size_t fieldIndex,
188 uint32_t dataLength)
const;
Definition: DatabaseStatement.h:38
Definition: DateTime.h:86
Definition: FieldList.h:50
Definition: MySQLStatement.h:49
void setParameterValues() override
static enum_field_types variantTypeToMySQLType(VariantDataType dataType)
void readResultRow(FieldList &fields)
void prepare(const String &sql) const
MySQLStatement(MySQLStatement &&)=default
void bindResult(FieldList &fields)
MySQLStatement(MySQLConnection *connection, String sql, bool autoPrepare)
MySQLStatement(const MySQLStatement &)=delete
static VariantDataType mySQLTypeToVariantType(enum_field_types mysqlType)
MySQLStatement & operator=(const MySQLStatement &)=delete
MySQLStatement & operator=(MySQLStatement &&)=default
static void dateTimeToMySQLDate(MYSQL_TIME &mysqlDate, DateTime timestamp, VariantDataType timeType)
void enumerateParams(QueryParameterList &queryParams) override
void execute(bool) override
Definition: QueryParameterList.h:57
VariantDataType
Definition: VariantData.h:44