|
Lightweight 0.20260617.0
|
#include <SqlMigration.hpp>
Inherits Lightweight::SqlException.
Public Types | |
| enum class | Operation : std::uint8_t { Apply , Revert } |
| Whether the failure happened while applying (Up) or reverting (Down). More... | |
Public Member Functions | |
| LIGHTWEIGHT_API | MigrationException (Operation operation, MigrationTimestamp timestamp, std::string title, std::size_t stepIndex, std::string failedSql, SqlErrorInfo driverError) |
| Operation | GetOperation () const noexcept |
| Whether the failure occurred while applying or reverting. | |
| MigrationTimestamp | GetMigrationTimestamp () const noexcept |
| Timestamp of the failing migration. | |
| std::string const & | GetMigrationTitle () const noexcept |
| Human-readable title of the failing migration. | |
| std::size_t | GetStepIndex () const noexcept |
| Zero-based step index inside the plan of the failing migration. | |
| std::string const & | GetFailedSql () const noexcept |
| The exact SQL statement that the driver rejected. | |
| std::string const & | GetDriverMessage () const noexcept |
Exception thrown when applying or reverting a single migration fails.
Carries structured diagnostic context so callers (CLI, GUI) can render the which migration, which step, which SQL statement and the underlying driver error as separate fields instead of parsing one opaque message string.
Definition at line 65 of file SqlMigration.hpp.
|
strong |
Whether the failure happened while applying (Up) or reverting (Down).
Definition at line 69 of file SqlMigration.hpp.
| LIGHTWEIGHT_API Lightweight::SqlMigration::MigrationException::MigrationException | ( | Operation | operation, |
| MigrationTimestamp | timestamp, | ||
| std::string | title, | ||
| std::size_t | stepIndex, | ||
| std::string | failedSql, | ||
| SqlErrorInfo | driverError | ||
| ) |
Constructs a migration exception that wraps a driver error with the migration identity and the exact SQL statement that failed.
| operation | Whether the failure happened during apply or revert. |
| timestamp | The migration that failed. |
| title | Human-readable migration title. |
| stepIndex | Zero-based step index inside the migration plan. |
| failedSql | The SQL statement that produced the driver error. |
| driverError | The ODBC-level error info as received from the driver. |
|
inlinenoexcept |
Whether the failure occurred while applying or reverting.
Definition at line 92 of file SqlMigration.hpp.
|
inlinenoexcept |
Timestamp of the failing migration.
Definition at line 97 of file SqlMigration.hpp.
|
inlinenoexcept |
Human-readable title of the failing migration.
Definition at line 102 of file SqlMigration.hpp.
|
inlinenoexcept |
Zero-based step index inside the plan of the failing migration.
Definition at line 107 of file SqlMigration.hpp.
|
inlinenoexcept |
The exact SQL statement that the driver rejected.
Definition at line 112 of file SqlMigration.hpp.
|
inlinenoexcept |
Raw driver error message, without the migration context prefix that what() and info().message decorate it with.
Definition at line 118 of file SqlMigration.hpp.