cloudspannerecosystem/wrench

Preserve comments for schema.sql

Opened this issue · 1 comments

110y commented

WHAT

  • Preserve comments for schema.sql
    • when execute migrations to DB, wrench should strip comments in the schema file.
    • when load schema from DB, wrench should preserve comments and then apply comments to the schema file.

WHY

  • would like to write comments to the schema file although Spanner does not recognize comments.

Can we expect any improvement with this issue in the near future?

We have lots of problems with documenting our migration SQLs in separate files. It would be much nicer to keep comments in the SQL scripts but currently wrench doesn't support them.

If this issue won't be solved, I would propose a different idea. I would also strip the comments but not with regexps. I don't think this approach is reliable enough. I would rather parse the input rune-by-rune and switch between string, comment and normal mode according to the subsequent characters.

Can I start working on it?