Summary
Replace or harden the SQL script splitting logic used by FileMigrationsRunner.
Migration files may contain semicolons inside strings, comments, quoted identifiers, triggers, or procedural blocks.
Current behavior
The current splitter tracks only basic single-quoted and double-quoted strings.
It does not fully handle:
- escaped quotes;
- SQL comments;
- backtick identifiers;
- trigger bodies;
- dialect-specific blocks;
- delimiter directives;
- PostgreSQL dollar-quoted strings.
Expected behavior
Migration scripts must be executed without incorrectly splitting valid SQL constructs.
The implementation may use backend-native multi-statement execution where appropriate or a dedicated parser with clearly documented supported syntax.
Scope
Suggested files
modules/db/src/mig/FileMigrationsRunner.cpp
modules/db/tests/file_migrations_runner_test.cpp
modules/db/tests/fixtures/migrations/...
Acceptance criteria
Non-goals
This issue does not include:
- building a complete SQL parser;
- automatic SQL dialect translation;
- ORM migration generation;
- changing migration filenames.
Suggested labels
scope:db
type:enhancement
tests
help wanted
status:accepted
Summary
Replace or harden the SQL script splitting logic used by
FileMigrationsRunner.Migration files may contain semicolons inside strings, comments, quoted identifiers, triggers, or procedural blocks.
Current behavior
The current splitter tracks only basic single-quoted and double-quoted strings.
It does not fully handle:
Expected behavior
Migration scripts must be executed without incorrectly splitting valid SQL constructs.
The implementation may use backend-native multi-statement execution where appropriate or a dedicated parser with clearly documented supported syntax.
Scope
Suggested files
modules/db/src/mig/FileMigrationsRunner.cppmodules/db/tests/file_migrations_runner_test.cppmodules/db/tests/fixtures/migrations/...Acceptance criteria
Non-goals
This issue does not include:
Suggested labels
scope:dbtype:enhancementtestshelp wantedstatus:accepted