Lightweight 0.1.0
|
Query builder for building CREATE TABLE queries. More...
#include <Migrate.hpp>
Public Member Functions | |
SqlCreateTableQueryBuilder (SqlCreateTablePlan &plan) | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | Column (SqlColumnDeclaration column) |
Adds a new column to the table. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | Column (std::string columnName, SqlColumnTypeDefinition columnType) |
Creates a new nullable column. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | RequiredColumn (std::string columnName, SqlColumnTypeDefinition columnType) |
Creates a new column that is non-nullable. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | Timestamps () |
Adds the created_at and updated_at columns to the table. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | PrimaryKey (std::string columnName, SqlColumnTypeDefinition columnType) |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | PrimaryKeyWithAutoIncrement (std::string columnName, SqlColumnTypeDefinition columnType=SqlColumnTypeDefinitions::Bigint {}) |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | ForeignKey (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition foreignKey) |
Creates a new nullable foreign key column. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | RequiredForeignKey (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition foreignKey) |
Creates a new non-nullable foreign key column. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | Unique () |
Enables the UNIQUE constraint on the last declared column. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | Index () |
Enables the INDEX constraint on the last declared column. | |
LIGHTWEIGHT_API SqlCreateTableQueryBuilder & | UniqueIndex () |
Enables the UNIQUE and INDEX constraint on the last declared column and makes it an index. | |
Query builder for building CREATE TABLE queries.
Definition at line 14 of file Migrate.hpp.
|
inlineexplicit |
Definition at line 17 of file Migrate.hpp.
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.