Mantis App v0.1.13
Loading...
Searching...
No Matches
mantis::Field Struct Reference

#include <models.h>

Public Member Functions

 Field (std::string n, FieldType t, bool req=false, bool pk=false, bool sys=false, json opts=json::object())
 
json to_json () const
 
soci::db_type toSociType () const
 

Static Public Member Functions

static soci::db_type toSociType (const FieldType &f_type)
 

Public Attributes

std::string name
 
FieldType type
 
bool required = false
 
bool primaryKey = false
 
bool system = false
 
std::optional< std::string > defaultValue
 
std::optional< std::string > regexPattern
 
std::optional< double > minValue
 
std::optional< double > maxValue
 
bool isUnique = false
 
std::optional< std::string > validator
 
std::optional< std::string > autoGeneratePattern
 

Constructor & Destructor Documentation

◆ Field()

mantis::Field::Field ( std::string  n,
FieldType  t,
bool  req = false,
bool  pk = false,
bool  sys = false,
json  opts = json::object() 
)

Member Function Documentation

◆ to_json()

json mantis::Field::to_json ( ) const

◆ toSociType() [1/2]

soci::db_type mantis::Field::toSociType ( ) const

◆ toSociType() [2/2]

soci::db_type mantis::Field::toSociType ( const FieldType f_type)
static

Member Data Documentation

◆ autoGeneratePattern

std::optional<std::string> mantis::Field::autoGeneratePattern

◆ defaultValue

std::optional<std::string> mantis::Field::defaultValue

◆ isUnique

bool mantis::Field::isUnique = false

◆ maxValue

std::optional<double> mantis::Field::maxValue

◆ minValue

std::optional<double> mantis::Field::minValue

◆ name

std::string mantis::Field::name

◆ primaryKey

bool mantis::Field::primaryKey = false

◆ regexPattern

std::optional<std::string> mantis::Field::regexPattern

◆ required

bool mantis::Field::required = false

◆ system

bool mantis::Field::system = false

◆ type

FieldType mantis::Field::type

◆ validator

std::optional<std::string> mantis::Field::validator

The documentation for this struct was generated from the following files: