Generate a Live Database Schema Diagram for your Catalyst Application
When building a web application, I always create a URL endpoint ...
For further actions, you may consider blocking this person and/or reporting abuse
Oh wow, this is perfect! I recently started a job in which a primary role is maintaining and extending a rather large Catalyst app and I have never used Catalyst before. I'm also about ten years out-of-date on my Perl knowledge. So, every little bit helps. :)
Congrats on the new job, thanks for letting me know this was helpful.
A production system should not have this endpoint at all. This is bad as a security practice and means that your automation as failed or does not exist at all.
Please if you really need it just expose it from the command line.
NOTE: having ssh access to a production system also means failure in you automation pipeline.
You raise a good point: this feature is obviously to support development, not for production
What's
:Local
and:Args(0)
?These function attributes are particular to the Catalyst MVC Framework.
You would include this function in a Catalyst::Controller package. In this case, you may choose
YourApp::Controller::Debug
as the controller name.Catalyst will map this dbdiagram action to an application URL, as specified by these function attributes.
With
:Local
, this action URL part will be the function name, relative to the controller name.http://yourapp/debug/dbdiagram
A Catalyst action can receive function arguments as parts of the request URL.
:Args(0)
specifies this action will receive 0 arguments this way. This makes Pretty URL's easy. dbdiagram might accept a database name, and table name as arguments. This action would respond to the URL:http://yourapp/debug/dbdiagram/database_name/table_name
.