dbsrgits / sql-translator

SQL::Translator (SQLFairy)
http://sqlfairy.sourceforge.net/
82 stars 91 forks source link

Feature: Add DB comments for PG producer #137

Closed rabbiveesh closed 2 years ago

rabbiveesh commented 2 years ago

Many databases support storing comments as part of the actual schema. Postgres is one of them, just the syntax is slightly different than other RDBMS, b/c you can't define it inline with the table definition.

This PR adds the ability to write out comments using the COMMENT command documented here.

It follows the example of the MySQL producer and puts all comments into the schema, including ones that were parsed as DDL only comments (line comments starting with --).