Describes a database column field.
More...
#include <field.hpp>
|
| field () |
| Creates an empty field.
|
|
| field (const char *name) |
| Creates a named field.
|
|
| field (const std::string &name) |
| Creates a named field.
|
|
| ~field () |
| Destroy a field.
|
|
size_t | index () const |
| Returns the index of the field in table.
|
|
void | index (size_t i) |
| Sets the index in table of the field.
|
|
std::string | name () const |
| Returns the name of the field.
|
|
void | name (const std::string &n) |
| Sets the name of the field.
|
|
database_type | type () const |
| Returns the type of the field.
|
|
void | type (database_type t) |
| Sets the type of the field.
|
|
std::size_t | size () const |
| Returns the size of the field.
|
|
void | size (std::size_t s) |
| Sets the size of the field.
|
|
std::size_t | precision () const |
| Returns the precision of the field.
|
|
void | precision (std::size_t p) |
| Sets the precision of the field.
|
|
bool | is_not_null () const |
| Returns true if NULL value is not allowed.
|
|
void | not_null (bool nn) |
| Set to true if NULL value is not allowed for this field.
|
|
std::string | default_value () const |
| Returns the default value as string.
|
|
void | default_value (const std::string &value) |
| Sets the default value as string.
|
|
Describes a database column field.
◆ field() [1/2]
matador::field::field |
( |
const char * |
name | ) |
|
|
explicit |
Creates a named field.
- Parameters
-
name | Name of the column field |
◆ field() [2/2]
matador::field::field |
( |
const std::string & |
name | ) |
|
|
explicit |
Creates a named field.
- Parameters
-
name | Name of the column field |
◆ default_value() [1/2]
std::string matador::field::default_value |
( |
| ) |
const |
Returns the default value as string.
- Returns
- Default value as string
◆ default_value() [2/2]
void matador::field::default_value |
( |
const std::string & |
value | ) |
|
Sets the default value as string.
- Parameters
-
value | Default value as string |
◆ index() [1/2]
size_t matador::field::index |
( |
| ) |
const |
Returns the index of the field in table.
- Returns
- Index of the field in table
◆ index() [2/2]
void matador::field::index |
( |
size_t |
i | ) |
|
Sets the index in table of the field.
- Parameters
-
◆ is_not_null()
bool matador::field::is_not_null |
( |
| ) |
const |
Returns true if NULL value is not allowed.
- Returns
- True if NULL value is not allowed
◆ name() [1/2]
std::string matador::field::name |
( |
| ) |
const |
Returns the name of the field.
- Returns
- Name of the field
◆ name() [2/2]
void matador::field::name |
( |
const std::string & |
n | ) |
|
Sets the name of the field.
- Parameters
-
n | Name of the field to set |
◆ not_null()
void matador::field::not_null |
( |
bool |
nn | ) |
|
Set to true if NULL value is not allowed for this field.
- Parameters
-
nn | True if NULL value is not allowed |
◆ precision() [1/2]
std::size_t matador::field::precision |
( |
| ) |
const |
Returns the precision of the field.
Return the precision of the field if field is of type float or double
- Returns
- Precision of the field
◆ precision() [2/2]
void matador::field::precision |
( |
std::size_t |
p | ) |
|
Sets the precision of the field.
Has only an effect if the field type is float or double.
- Parameters
-
p | Precision of the field to set |
◆ size() [1/2]
std::size_t matador::field::size |
( |
| ) |
const |
Returns the size of the field.
Return the size of the field if field is a numeric or varchar type.
- Returns
- Size of the field
◆ size() [2/2]
void matador::field::size |
( |
std::size_t |
s | ) |
|
Sets the size of the field.
Has only an effect if the type of the field is numeric or varchar.
- Parameters
-
s | Size of the field to set |
◆ type() [1/2]
Returns the type of the field.
- Returns
- Type of the field
◆ type() [2/2]
Sets the type of the field.
- Parameters
-
t | Type of the field to set |
The documentation for this class was generated from the following file: