Lightweight 0.20260303.0
Loading...
Searching...
No Matches
Lightweight::SqlSchema::Column Struct Reference

Holds the definition of a column in a SQL table as read from the database schema. More...

#include <SqlSchema.hpp>

Public Attributes

std::string name = {}
 The name of the column.
 
SqlColumnTypeDefinition type = {}
 The SQL column type definition.
 
std::string dialectDependantTypeString = {}
 The dialect-dependent type string.
 
bool isNullable = true
 Whether the column allows NULL values.
 
bool isUnique = false
 Whether the column has a UNIQUE constraint.
 
size_t size = 0
 The size of the column (for character/binary types).
 
unsigned short decimalDigits = 0
 The number of decimal digits (for numeric types).
 
bool isAutoIncrement = false
 Whether the column auto-increments.
 
bool isPrimaryKey = false
 Whether the column is a primary key.
 
bool isForeignKey = false
 Whether the column is a foreign key.
 
std::optional< ForeignKeyConstraint > foreignKeyConstraint {}
 The foreign key constraint, if any.
 
std::string defaultValue = {}
 The default value of the column.
 

Detailed Description

Holds the definition of a column in a SQL table as read from the database schema.

Definition at line 119 of file SqlSchema.hpp.

Member Data Documentation

◆ name

std::string Lightweight::SqlSchema::Column::name = {}

The name of the column.

Definition at line 122 of file SqlSchema.hpp.

◆ type

SqlColumnTypeDefinition Lightweight::SqlSchema::Column::type = {}

The SQL column type definition.

Definition at line 124 of file SqlSchema.hpp.

◆ dialectDependantTypeString

std::string Lightweight::SqlSchema::Column::dialectDependantTypeString = {}

The dialect-dependent type string.

Definition at line 126 of file SqlSchema.hpp.

◆ isNullable

bool Lightweight::SqlSchema::Column::isNullable = true

Whether the column allows NULL values.

Definition at line 128 of file SqlSchema.hpp.

◆ isUnique

bool Lightweight::SqlSchema::Column::isUnique = false

Whether the column has a UNIQUE constraint.

Definition at line 130 of file SqlSchema.hpp.

◆ size

size_t Lightweight::SqlSchema::Column::size = 0

The size of the column (for character/binary types).

Definition at line 132 of file SqlSchema.hpp.

◆ decimalDigits

unsigned short Lightweight::SqlSchema::Column::decimalDigits = 0

The number of decimal digits (for numeric types).

Definition at line 134 of file SqlSchema.hpp.

◆ isAutoIncrement

bool Lightweight::SqlSchema::Column::isAutoIncrement = false

Whether the column auto-increments.

Definition at line 136 of file SqlSchema.hpp.

◆ isPrimaryKey

bool Lightweight::SqlSchema::Column::isPrimaryKey = false

Whether the column is a primary key.

Definition at line 138 of file SqlSchema.hpp.

◆ isForeignKey

bool Lightweight::SqlSchema::Column::isForeignKey = false

Whether the column is a foreign key.

Definition at line 140 of file SqlSchema.hpp.

◆ foreignKeyConstraint

std::optional<ForeignKeyConstraint> Lightweight::SqlSchema::Column::foreignKeyConstraint {}

The foreign key constraint, if any.

Definition at line 142 of file SqlSchema.hpp.

◆ defaultValue

std::string Lightweight::SqlSchema::Column::defaultValue = {}

The default value of the column.

Definition at line 144 of file SqlSchema.hpp.


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