Botan 3.13.0
Crypto and TLS for C&
Botan::SQL_Database::Column Class Reference

#include <database.h>

Public Member Functions

 Column (std::string name, Column_Type type)
bool is_not_null () const
bool is_primary_key () const
bool is_unique () const
const std::string & name () const
Columnnot_null ()
Columnprimary_key ()
Column_Type type () const
Columnunique ()

Detailed Description

The name, type and constraints of one column of a table

Definition at line 205 of file database.h.

Constructor & Destructor Documentation

◆ Column()

Botan::SQL_Database::Column::Column ( std::string name,
Column_Type type )
inline

Declare a column

Parameters
namethe name of the column
typethe type of the column

Definition at line 212 of file database.h.

212: m_name(std::move(name)), m_type(type) {}
Column_Type type() const
Definition database.h:251
const std::string & name() const
Definition database.h:245

References name(), and type().

Referenced by not_null(), primary_key(), and unique().

Member Function Documentation

◆ is_not_null()

bool Botan::SQL_Database::Column::is_not_null ( ) const
inline

Query whether this column is NOT NULL

Returns
true if not_null was called

Definition at line 263 of file database.h.

263{ return m_not_null; }

◆ is_primary_key()

bool Botan::SQL_Database::Column::is_primary_key ( ) const
inline

Query whether this column is part of the primary key

Returns
true if primary_key was called

Definition at line 257 of file database.h.

257{ return m_primary_key; }

◆ is_unique()

bool Botan::SQL_Database::Column::is_unique ( ) const
inline

Query whether this column is UNIQUE

Returns
true if unique was called

Definition at line 269 of file database.h.

269{ return m_unique; }

◆ name()

const std::string & Botan::SQL_Database::Column::name ( ) const
inline

Query the column name

Returns
the name of the column

Definition at line 245 of file database.h.

245{ return m_name; }

Referenced by Column().

◆ not_null()

Column & Botan::SQL_Database::Column::not_null ( )
inline

Mark this column as NOT NULL

Returns
reference to this

Definition at line 227 of file database.h.

227 {
228 m_not_null = true;
229 return *this;
230 }

References Column().

◆ primary_key()

Column & Botan::SQL_Database::Column::primary_key ( )
inline

Mark this column as part of the primary key

Returns
reference to this

Definition at line 218 of file database.h.

218 {
219 m_primary_key = true;
220 return *this;
221 }

References Column().

◆ type()

Column_Type Botan::SQL_Database::Column::type ( ) const
inline

Query the column type

Returns
the type of the column

Definition at line 251 of file database.h.

251{ return m_type; }

Referenced by Column().

◆ unique()

Column & Botan::SQL_Database::Column::unique ( )
inline

Mark this column as UNIQUE

Returns
reference to this

Definition at line 236 of file database.h.

236 {
237 m_unique = true;
238 return *this;
239 }

References Column().


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