[DBIx-Class-Devel] [dbsrgits/sql-translator] Fix bugs in Parser::DBI::PostgreSQL data_type, size, and default_value (PR #155)

M Conrad notifications at github.com
Wed Jan 4 04:10:37 GMT 2023


I'm rather surprised to find bugs this large, so please review and see if I have any wrong assumptions here.

I'm running into cases where postgres round-trip from a DBI connection was generating a lot of syntax errors.  It seems to have broken handling of column types with sizes, and broken handling of default values for anything other than numeric constants.

The changes are maybe best described by the changes to unit test 66.  You can see that the parser used to store char column size in the data_type instead of ->size field, and have an incorrect value in the ->size field, and store literal DDL as plain strings for the default_value.  I changed these to behave like other parsers and put the real size in the size column, and use scalar-refs for any default value that is literal DDL.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Fix default values returned by Parser::DBI::PostgreSQL
  * Fix data_type and size returned by Parser::DBI::PostgreSQL

-- File Changes --

    M lib/SQL/Translator/Parser/DBI/PostgreSQL.pm (32)
    M t/66-postgres-dbi-parser.t (26)

-- Patch Links --

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

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

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


More information about the DBIx-Class-Devel mailing list