|
relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
|
Classes | |
| struct | CommandLineArgs |
| Command-line argument parsing result. More... | |
Typedefs | |
| using | MigrationGenerator = std::function< MigrationResult< Migration >(const std::string &, const std::string &)> |
| Type alias for a function that generates a migration between two versions. | |
| using | CreateMigrationGenerator = std::function< MigrationResult< Migration >(const std::string &)> |
| Type alias for a function that generates a create table migration. | |
| using | DropMigrationGenerator = std::function< MigrationResult< Migration >(const std::string &)> |
| Type alias for a function that generates a drop table migration. | |
Functions | |
| void | print_usage (const char *program_name, const std::vector< std::string > &supported_versions={}) |
| Print usage information for a migration command-line tool. | |
| void | print_usage (const char *program_name, const std::vector< std::string > &supported_versions, bool create_available, bool drop_available) |
| Print usage information for a migration command-line tool with customizable options. | |
| void | write_migration_to_file (const Migration &migration, const std::string &filename, bool include_rollback=true) |
| Write a migration to a SQL file with proper formatting. | |
| void | print_migration (const Migration &migration) |
| Print a migration to the console with formatting. | |
| CommandLineArgs | parse_args (const std::vector< std::string > &args) |
| Parse command-line arguments for migration tools. | |
| int | run_migration_tool (int argc, char *argv[], const std::vector< std::string > &supported_versions, MigrationGenerator migration_generator, std::optional< CreateMigrationGenerator > create_generator=std::nullopt, std::optional< DropMigrationGenerator > drop_generator=std::nullopt) |
| Run a complete migration command-line tool. | |
| using relx::migrations::cli::CreateMigrationGenerator = typedef std::function<MigrationResult<Migration>(const std::string&)> |
Type alias for a function that generates a create table migration.
| version | The version to create |
Definition at line 65 of file command_line_tools.hpp.
| using relx::migrations::cli::DropMigrationGenerator = typedef std::function<MigrationResult<Migration>(const std::string&)> |
Type alias for a function that generates a drop table migration.
| version | The version to drop |
Definition at line 70 of file command_line_tools.hpp.
| using relx::migrations::cli::MigrationGenerator = typedef std::function<MigrationResult<Migration>(const std::string&, const std::string&)> |
Type alias for a function that generates a migration between two versions.
| from_version | The starting version |
| to_version | The target version |
Definition at line 59 of file command_line_tools.hpp.
| CommandLineArgs relx::migrations::cli::parse_args | ( | const std::vector< std::string > & | args | ) |
Parse command-line arguments for migration tools.
| args | Command-line arguments (excluding program name) |
| void relx::migrations::cli::print_migration | ( | const Migration & | migration | ) |
Print a migration to the console with formatting.
| migration | The migration to print |
| void relx::migrations::cli::print_usage | ( | const char * | program_name, |
| const std::vector< std::string > & | supported_versions, | ||
| bool | create_available, | ||
| bool | drop_available | ||
| ) |
Print usage information for a migration command-line tool with customizable options.
| program_name | The name of the program executable |
| supported_versions | List of supported version strings (e.g., {"v1", "v2", "v3"}) |
| create_available | Whether CREATE table functionality is available |
| drop_available | Whether DROP table functionality is available |
| void relx::migrations::cli::print_usage | ( | const char * | program_name, |
| const std::vector< std::string > & | supported_versions = {} |
||
| ) |
Print usage information for a migration command-line tool.
| program_name | The name of the program executable |
| supported_versions | List of supported version strings (e.g., {"v1", "v2", "v3"}) |
| int relx::migrations::cli::run_migration_tool | ( | int | argc, |
| char * | argv[], | ||
| const std::vector< std::string > & | supported_versions, | ||
| MigrationGenerator | migration_generator, | ||
| std::optional< CreateMigrationGenerator > | create_generator = std::nullopt, |
||
| std::optional< DropMigrationGenerator > | drop_generator = std::nullopt |
||
| ) |
Run a complete migration command-line tool.
| argc | Command-line argument count |
| argv | Command-line argument values |
| supported_versions | List of supported version strings |
| migration_generator | Function to generate migrations between versions |
| create_generator | Optional function to generate create table migrations |
| drop_generator | Optional function to generate drop table migrations |
| void relx::migrations::cli::write_migration_to_file | ( | const Migration & | migration, |
| const std::string & | filename, | ||
| bool | include_rollback = true |
||
| ) |
Write a migration to a SQL file with proper formatting.
| migration | The migration to write |
| filename | The output filename |
| include_rollback | Whether to include rollback SQL as comments (default: true) |