MySQL++ Reference Manual

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# mysqlpp::Field Class Reference

Class to hold information about a SQL field. More...

`#include <field.h>`

Collaboration diagram for mysqlpp::Field:

[legend]
List of all members.

## 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.
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.

## Detailed Description

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.

## Member Function Documentation

size_t mysqlpp::Field::length | ( |  | ) | const`[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.

The documentation for this class was generated from the following file:

- field.h