Lightweight 0.20260303.0
Loading...
Searching...
No Matches
Lightweight::SqlMigration::MigrationManager::PlanFoldingResult Struct Reference

Snapshot of the schema the registered migrations intend to produce. More...

#include <SqlMigration.hpp>

Classes

struct  DataStep
 One data step (INSERT/UPDATE/DELETE/RawSql) tagged with its source migration. More...
 
struct  TableState
 Per-table state: ordered column declarations + per-table FK list. More...
 

Public Attributes

std::map< SqlSchema::FullyQualifiedTableName, TableStatetables
 
std::vector< SqlSchema::FullyQualifiedTableName > creationOrder
 
std::vector< SqlCreateIndexPlanindexes
 Indexes that survive folding (created on tables still present at end).
 
std::vector< DataStepdataSteps
 
std::vector< MigrationReleasereleases
 Releases declared via LIGHTWEIGHT_SQL_RELEASE that fall within the fold range.
 
std::vector< std::pair< MigrationTimestamp, std::string > > foldedMigrations
 

Detailed Description

Snapshot of the schema the registered migrations intend to produce.

Pure plan-walk — never executes SQL, never opens a connection. Folds the effects of every registered migration (up to an optional cut-off timestamp) into a per-table view of "the final shape" plus a chronological list of data steps and surviving indexes/releases. Used by dbtool fold to emit a self-contained baseline (.cpp plugin or .sql).

Definition at line 309 of file SqlMigration.hpp.

Member Data Documentation

◆ tables

std::map<SqlSchema::FullyQualifiedTableName, TableState> Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::tables

(schema, table) → folded TableState. Insertion order is not preserved by std::map — for emission order use creationOrder below.

Definition at line 326 of file SqlMigration.hpp.

◆ creationOrder

std::vector<SqlSchema::FullyQualifiedTableName> Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::creationOrder

Tables in creation order (first-time-seen). Reverse for safe DROP ordering when tearing the schema down.

Definition at line 330 of file SqlMigration.hpp.

◆ indexes

std::vector<SqlCreateIndexPlan> Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::indexes

Indexes that survive folding (created on tables still present at end).

Definition at line 333 of file SqlMigration.hpp.

◆ dataSteps

std::vector<DataStep> Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::dataSteps

Data steps in chronological order. No coalescing — the fold replays every data step verbatim, exactly as if migrations were applied in order.

Definition at line 350 of file SqlMigration.hpp.

◆ releases

std::vector<MigrationRelease> Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::releases

Releases declared via LIGHTWEIGHT_SQL_RELEASE that fall within the fold range.

Definition at line 353 of file SqlMigration.hpp.

◆ foldedMigrations

std::vector<std::pair<MigrationTimestamp, std::string> > Lightweight::SqlMigration::MigrationManager::PlanFoldingResult::foldedMigrations

Migrations that contributed to the fold (timestamp + title). Used by emitters to write a header comment explaining what was collapsed.

Definition at line 357 of file SqlMigration.hpp.


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