Lightweight 0.1.0
Loading...
Searching...
No Matches
SqlCreateTableQueryBuilder Class Referencefinal

Query builder for building CREATE TABLE queries. More...

#include <Migrate.hpp>

Public Member Functions

 SqlCreateTableQueryBuilder (SqlCreateTablePlan &plan)
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderColumn (SqlColumnDeclaration column)
 Adds a new column to the table.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderColumn (std::string columnName, SqlColumnTypeDefinition columnType)
 Creates a new nullable column.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderRequiredColumn (std::string columnName, SqlColumnTypeDefinition columnType)
 Creates a new column that is non-nullable.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderTimestamps ()
 Adds the created_at and updated_at columns to the table.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderPrimaryKey (std::string columnName, SqlColumnTypeDefinition columnType)
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderPrimaryKeyWithAutoIncrement (std::string columnName, SqlColumnTypeDefinition columnType=SqlColumnTypeDefinitions::Bigint {})
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderForeignKey (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition foreignKey)
 Creates a new nullable foreign key column.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderRequiredForeignKey (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition foreignKey)
 Creates a new non-nullable foreign key column.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderUnique ()
 Enables the UNIQUE constraint on the last declared column.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderIndex ()
 Enables the INDEX constraint on the last declared column.
 
LIGHTWEIGHT_API SqlCreateTableQueryBuilderUniqueIndex ()
 Enables the UNIQUE and INDEX constraint on the last declared column and makes it an index.
 

Detailed Description

Query builder for building CREATE TABLE queries.

See also
SqlQueryBuilder

Definition at line 14 of file Migrate.hpp.

Constructor & Destructor Documentation

◆ SqlCreateTableQueryBuilder()

SqlCreateTableQueryBuilder::SqlCreateTableQueryBuilder ( SqlCreateTablePlan &  plan)
inlineexplicit

Definition at line 17 of file Migrate.hpp.

Member Function Documentation

◆ PrimaryKey()

LIGHTWEIGHT_API SqlCreateTableQueryBuilder & SqlCreateTableQueryBuilder::PrimaryKey ( std::string  columnName,
SqlColumnTypeDefinition  columnType 
)

Creates a new primary key column. Primary keys are always required, unique, have an index, and are non-nullable.


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