[DBIx-Class-Devel] [dbsrgits/sql-translator] Feature: Add DB comments for PG producer (PR #137)

Veesh Goldman notifications at github.com
Thu Jul 7 21:26:55 GMT 2022


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](https://www.postgresql.org/docs/current/sql-comment.html). 

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 `--`).

You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/sql-translator/pull/137

-- Commit Summary --

  * update parser test to assert that parsing COMMENT comments work on Producer::PG
  * implementation of comment DDL *should* be correct
  * woops, didn't understand how `->comments` worked
  * get this right and fix all the tests!

-- File Changes --

    M lib/SQL/Translator/Parser/PostgreSQL.pm (1)
    M lib/SQL/Translator/Producer/PostgreSQL.pm (29)
    M t/46xml-to-pg.t (2)
    M t/47postgres-producer.t (17)

-- Patch Links --

https://github.com/dbsrgits/sql-translator/pull/137.patch
https://github.com/dbsrgits/sql-translator/pull/137.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/137
You are receiving this because you are subscribed to this thread.

Message ID: <dbsrgits/sql-translator/pull/137 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20220707/c15960d6/attachment.htm>


More information about the DBIx-Class-Devel mailing list