|
Lightweight 0.20251202.0
|
Query builder for building ALTER TABLE queries. More...
#include <Migrate.hpp>
Public Member Functions | |
| SqlAlterTableQueryBuilder (SqlAlterTablePlan &plan) | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | RenameTo (std::string_view newTableName) |
| Renames the table. | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddColumn (std::string columnName, SqlColumnTypeDefinition columnType) |
| Adds a new column to the table that is non-nullable. | |
| template<auto MemberPointer> | |
| SqlAlterTableQueryBuilder & | AddColumn () |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddNotRequiredColumn (std::string columnName, SqlColumnTypeDefinition columnType) |
| Adds a new column to the table that is nullable. | |
| template<auto MemberPointer> | |
| SqlAlterTableQueryBuilder & | AddNotRequiredColumn () |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AlterColumn (std::string columnName, SqlColumnTypeDefinition columnType, SqlNullable nullable) |
| Alters the column to have a new non-nullable type. | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | RenameColumn (std::string_view oldColumnName, std::string_view newColumnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | DropColumn (std::string_view columnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddColumnIfNotExists (std::string columnName, SqlColumnTypeDefinition columnType) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddNotRequiredColumnIfNotExists (std::string columnName, SqlColumnTypeDefinition columnType) |
| Adds a new nullable column to the table only if it does not already exist. | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | DropColumnIfExists (std::string_view columnName) |
| Drops a column from the table only if it exists. | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddIndex (std::string_view columnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddUniqueIndex (std::string_view columnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | DropIndex (std::string_view columnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | DropIndexIfExists (std::string_view columnName) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddForeignKey (std::string columnName, SqlForeignKeyReferenceDefinition referencedColumn) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddForeignKeyColumn (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition referencedColumn) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddNotRequiredForeignKeyColumn (std::string columnName, SqlColumnTypeDefinition columnType, SqlForeignKeyReferenceDefinition referencedColumn) |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | DropForeignKey (std::string columnName) |
Drops a foreign key for the column columnName from the table. | |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & | AddCompositeForeignKey (std::vector< std::string > columns, std::string referencedTableName, std::vector< std::string > referencedColumns) |
Query builder for building ALTER TABLE queries.
Definition at line 88 of file Migrate.hpp.
|
inlineexplicit |
Definition at line 91 of file Migrate.hpp.
|
inline |
Adds a new column to the table that is non-nullable.
| MemberPointer | The pointer to the member field in the record. |
Definition at line 108 of file Migrate.hpp.
|
inline |
Adds a new column to the table that is nullable.
| MemberPointer | The pointer to the member field in the record. |
Definition at line 124 of file Migrate.hpp.
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AlterColumn | ( | std::string | columnName, |
| SqlColumnTypeDefinition | columnType, | ||
| SqlNullable | nullable | ||
| ) |
Alters the column to have a new non-nullable type.
| columnName | The name of the column to alter. |
| columnType | The new type of the column. |
| nullable | The new nullable state of the column. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::RenameColumn | ( | std::string_view | oldColumnName, |
| std::string_view | newColumnName | ||
| ) |
Renames a column.
| oldColumnName | The old column name. |
| newColumnName | The new column name. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::DropColumn | ( | std::string_view | columnName | ) |
Drops a column from the table.
| columnName | The name of the column to drop. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddColumnIfNotExists | ( | std::string | columnName, |
| SqlColumnTypeDefinition | columnType | ||
| ) |
Adds a new column to the table only if it does not already exist.
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddIndex | ( | std::string_view | columnName | ) |
Add an index to the table for the specified column.
| columnName | The name of the column to index. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddUniqueIndex | ( | std::string_view | columnName | ) |
Add an index to the table for the specified column that is unique.
| columnName | The name of the column to index. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::DropIndex | ( | std::string_view | columnName | ) |
Drop an index from the table for the specified column.
| columnName | The name of the column to drop the index from. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::DropIndexIfExists | ( | std::string_view | columnName | ) |
Drop an index from the table only if it exists.
| columnName | The name of the column to drop the index from. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddForeignKey | ( | std::string | columnName, |
| SqlForeignKeyReferenceDefinition | referencedColumn | ||
| ) |
Adds a foreign key column columnName to referencedColumn to an existing column.
| columnName | The name of the column to add. |
| referencedColumn | The column to reference. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddForeignKeyColumn | ( | std::string | columnName, |
| SqlColumnTypeDefinition | columnType, | ||
| SqlForeignKeyReferenceDefinition | referencedColumn | ||
| ) |
Adds a foreign key column columnName of type columnType to referencedColumn.
| columnName | The name of the column to add. |
| columnType | The type of the column to add. |
| referencedColumn | The column to reference. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddNotRequiredForeignKeyColumn | ( | std::string | columnName, |
| SqlColumnTypeDefinition | columnType, | ||
| SqlForeignKeyReferenceDefinition | referencedColumn | ||
| ) |
Adds a nullable foreign key column columnName of type columnType to referencedColumn.
| columnName | The name of the column to add. |
| columnType | The type of the column to add. |
| referencedColumn | The column to reference. |
| LIGHTWEIGHT_API SqlAlterTableQueryBuilder & Lightweight::SqlAlterTableQueryBuilder::AddCompositeForeignKey | ( | std::vector< std::string > | columns, |
| std::string | referencedTableName, | ||
| std::vector< std::string > | referencedColumns | ||
| ) |
Adds a composite foreign key constraint.
| columns | The columns in the current table. |
| referencedTableName | The referenced table name. |
| referencedColumns | The referenced columns in the referenced table. |