[DBIx-Class-Devel] [dbsrgits/sql-translator] MySQL Parser understands VIEWs with a field list. (#87)

Adam Herzog notifications at github.com
Mon Apr 17 12:52:44 GMT 2017


adherzog commented on this pull request.



> @@ -326,7 +326,7 @@ create : CREATE PROCEDURE NAME not_delimiter "$delimiter"
 PROCEDURE : /procedure/i
     | /function/i
 
-create : CREATE or_replace(?) create_view_option(s?) /view/i NAME /as/i view_select_statement "$delimiter"
+create : CREATE or_replace(?) create_view_option(s?) /view/i NAME parens_field_list(?) /as/i view_select_statement "$delimiter"

If we store the fields in the `%views` hash instead of setting the column aliases, then the generated SQL won't include the aliases. So I'm continuing to set the aliases, and both the generated SQL and the fields attribute are returning the correct results. (At least, according to the tests I added.)

I've used your simplified code (though I'm using `$item{'parens_field_list(?)'}[0]` instead of `$item{'parens_field_list(?)'}`, since it seems to be an arrayref within an arrayref) and left the rest the same.

@ilmari - Please review again when you have a chance.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/87#discussion_r111737897
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20170417/d3b2463b/attachment.htm>


More information about the DBIx-Class-Devel mailing list