![]() |
TrinityCore
|
Class used to access individual fields of database query result. More...
#include <Field.h>
Public Member Functions | |
| Field () | |
| ~Field () | |
| bool | GetBool () const |
| uint8 | GetUInt8 () const |
| int8 | GetInt8 () const |
| uint16 | GetUInt16 () const |
| int16 | GetInt16 () const |
| uint32 | GetUInt32 () const |
| int32 | GetInt32 () const |
| uint64 | GetUInt64 () const |
| int64 | GetInt64 () const |
| float | GetFloat () const |
| double | GetDouble () const |
| SystemTimePoint | GetDate () const |
| char const * | GetCString () const |
| std::string | GetString () const |
| std::string_view | GetStringView () const |
| std::vector< uint8 > | GetBinary () const |
| template<size_t S> | |
| std::array< uint8, S > | GetBinary () const |
| bool | IsNull () const |
Private Member Functions | |
| void | SetValue (char const *newValue, uint32 length) |
| void | SetMetadata (QueryResultFieldMetadata const *meta) |
| void | GetBinarySizeChecked (uint8 *buf, size_t size) const |
Private Attributes | |
| char const * | _value |
| uint32 | _length |
| QueryResultFieldMetadata const * | _meta |
Friends | |
| class | ResultSet |
| class | PreparedResultSet |
Class used to access individual fields of database query result.
Guideline on field type matching:
| MySQL type | method to use |
|---|---|
| TINYINT | GetBool, GetInt8, GetUInt8 |
| SMALLINT | GetInt16, GetUInt16 |
| MEDIUMINT, INT | GetInt32, GetUInt32 |
| BIGINT | GetInt64, GetUInt64 |
| FLOAT | GetFloat |
| DOUBLE, DECIMAL | GetDouble |
| CHAR, VARCHAR, | GetCString, GetString |
| TINYTEXT, MEDIUMTEXT, | GetCString, GetString |
| TEXT, LONGTEXT | GetCString, GetString |
| TINYBLOB, MEDIUMBLOB, | GetBinary, GetString |
| BLOB, LONGBLOB | GetBinary, GetString |
| BINARY, VARBINARY | GetBinary |
Return types of aggregate functions:
| Function | Type |
|---|---|
| MIN, MAX | Same as the field |
| SUM, AVG | DECIMAL |
| COUNT | BIGINT |
|
default |
| std::vector< uint8 > Field::GetBinary | ( | ) | const |
|
inline |
|
private |
|
inline |
| char const * Field::GetCString | ( | ) | const |
| SystemTimePoint Field::GetDate | ( | ) | const |
| double Field::GetDouble | ( | ) | const |
| float Field::GetFloat | ( | ) | const |
| int16 Field::GetInt16 | ( | ) | const |
| int32 Field::GetInt32 | ( | ) | const |
| int64 Field::GetInt64 | ( | ) | const |
| int8 Field::GetInt8 | ( | ) | const |
| std::string Field::GetString | ( | ) | const |
| std::string_view Field::GetStringView | ( | ) | const |
| uint16 Field::GetUInt16 | ( | ) | const |
| uint32 Field::GetUInt32 | ( | ) | const |
| uint64 Field::GetUInt64 | ( | ) | const |
| uint8 Field::GetUInt8 | ( | ) | const |
|
inline |
|
private |
|
private |
|
friend |
|
private |