MySQL++
3.3.0
|
Class to hold information about a SQL field. More...
#include <field.h>
Public Member Functions | |
Field () | |
Create empty object. | |
Field (const MYSQL_FIELD *pf) | |
Create object from C API field structure. | |
Field (const Field &other) | |
Create object as a copy of another Field. | |
bool | auto_increment () const |
Returns true if field auto-increments. | |
bool | binary_type () const |
Returns true if field is of some binary type. | |
bool | blob_type () const |
Returns true if field is of some BLOB type. | |
const char * | db () const |
Return the name of the database the field comes from. | |
bool | enumeration () const |
Returns true if field is of an enumerated value type. | |
size_t | length () const |
Return the creation size of the field. More... | |
size_t | max_length () const |
Return the maximum number of bytes stored in this field in any of the rows in the result set we were created from. | |
bool | multiple_key () const |
Returns true if field is part of a key. | |
const char * | name () const |
Return the field's name. | |
bool | primary_key () const |
Returns true if field is part of a primary key. | |
bool | set_type () const |
Returns true if field is of some 'set' type. | |
const char * | table () const |
Return the name of the table the field comes from. | |
bool | timestamp () const |
Returns true if field's type is timestamp. | |
const mysql_type_info & | type () const |
Return information about the field's type. | |
bool | unique_key () const |
Returns true if field is part of a unique key. | |
bool | zerofill () const |
Returns true if field has the zerofill attribute. | |
Class to hold information about a SQL field.
This is a cut-down version of MYSQL_FIELD, using MySQL++ and generic C++ types instead of the C types it uses, and hiding all fields behind accessors. It leaves out data members we have decided aren't very useful. Given a good argument, we're willing to mirror more of the fields; we just don't want to mirror the underlying structure slavishly for no benefit.
|
inline |
Return the creation size of the field.
This is the number of bytes the field can hold, not how much is actually stored in the field on any particular row.