|
relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
|
Namespaces | |
| namespace | cli |
Classes | |
| class | AddColumnOperation |
| ADD COLUMN migration operation. More... | |
| class | AddColumnOperation< ColumnMetadata > |
| Specialized AddColumnOperation for ColumnMetadata. More... | |
| class | AddConstraintOperation |
| ADD CONSTRAINT migration operation. More... | |
| struct | ColumnMetadata |
| Metadata about a column extracted from PFR analysis. More... | |
| struct | ConstraintMetadata |
| Metadata about a constraint extracted from PFR analysis. More... | |
| class | CreateTableOperation |
| CREATE TABLE migration operation. More... | |
| class | DropColumnOperation |
| DROP COLUMN migration operation. More... | |
| class | DropColumnOperation< ColumnMetadata > |
| Specialized DropColumnOperation for ColumnMetadata. More... | |
| class | DropConstraintOperation |
| DROP CONSTRAINT migration operation. More... | |
| class | DropTableOperation |
| DROP TABLE migration operation. More... | |
| class | Migration |
| Container for migration operations. More... | |
| struct | MigrationError |
| Error information for migration operations. More... | |
| class | MigrationOperation |
| Base class for migration operations. More... | |
| struct | MigrationOptions |
| Options for controlling migration generation. More... | |
| class | ModifyColumnOperation |
| MODIFY COLUMN migration operation. More... | |
| class | RenameColumnOperation |
| RENAME COLUMN migration operation. More... | |
| class | RenameConstraintOperation |
| RENAME CONSTRAINT migration operation. More... | |
| struct | TableMetadata |
| Complete metadata about a table. More... | |
| class | UpdateDataOperation |
| UPDATE DATA migration operation for column transformations. More... | |
Typedefs | |
| template<typename T > | |
| using | MigrationResult = std::expected< T, MigrationError > |
| Result type for migration operations. | |
Enumerations | |
| enum class | MigrationErrorType { INVALID_TABLE_STRUCTURE , UNSUPPORTED_OPERATION , COLUMN_NOT_FOUND , CONSTRAINT_NOT_FOUND , INCOMPATIBLE_TYPES , MIGRATION_GENERATION_FAILED , SQL_GENERATION_FAILED , VALIDATION_FAILED } |
| Error types for migration operations. More... | |
| enum class | OperationType { CREATE_TABLE , DROP_TABLE , ADD_COLUMN , DROP_COLUMN , RENAME_COLUMN , MODIFY_COLUMN , UPDATE_DATA , ADD_CONSTRAINT , DROP_CONSTRAINT , RENAME_CONSTRAINT , ADD_INDEX , DROP_INDEX } |
| Enum for migration operation types. More... | |
Functions | |
| template<schema::TableConcept Table> | |
| MigrationResult< TableMetadata > | extract_table_metadata (const Table &table_instance) |
| Extract table metadata using Boost.PFR. | |
| MigrationResult< Migration > | diff_tables (const TableMetadata &old_metadata, const TableMetadata &new_metadata, const MigrationOptions &options={}) |
| Generate migration from table metadata differences. | |
| template<schema::TableConcept OldTable, schema::TableConcept NewTable> | |
| MigrationResult< Migration > | generate_migration (const OldTable &old_table, const NewTable &new_table, const MigrationOptions &options={}) |
| Generate migration from old table to new table. | |
| template<schema::TableConcept Table> | |
| MigrationResult< Migration > | generate_create_table_migration (const Table &table) |
| Generate migration to create a new table. | |
| template<schema::TableConcept Table> | |
| MigrationResult< Migration > | generate_drop_table_migration (const Table &table) |
| Generate migration to drop a table. | |
| using relx::migrations::MigrationResult = typedef std::expected<T, MigrationError> |
|
strong |
|
strong |
| MigrationResult< Migration > relx::migrations::diff_tables | ( | const TableMetadata & | old_metadata, |
| const TableMetadata & | new_metadata, | ||
| const MigrationOptions & | options = {} |
||
| ) |
| MigrationResult< TableMetadata > relx::migrations::extract_table_metadata | ( | const Table & | table_instance | ) |
Extract table metadata using Boost.PFR.
Extract table metadata from a table instance.
| Table | The table type |
| table_instance | Instance of the table |
| Table | The table type |
| table | Instance of the table |
| MigrationResult< Migration > relx::migrations::generate_create_table_migration | ( | const Table & | table | ) |
| MigrationResult< Migration > relx::migrations::generate_drop_table_migration | ( | const Table & | table | ) |
| MigrationResult< Migration > relx::migrations::generate_migration | ( | const OldTable & | old_table, |
| const NewTable & | new_table, | ||
| const MigrationOptions & | options = {} |
||
| ) |
Generate migration from old table to new table.
| OldTable | The old table type |
| NewTable | The new table type |
| old_table | Instance of the old table |
| new_table | Instance of the new table |
| options | Migration options including column/constraint mappings |