Mojolicious::Plugin::DBViewer - Mojolicious plugin to display database information on browser
# Mojolicious::Lite plugin( 'DBViewer', dsn => "dbi:mysql:database=bookshop", user => 'ken', password => '!LFKD%$&' ); # Mojolicious $app->plugin( 'DBViewer', dsn => "dbi:mysql:database=bookshop", user => 'ken', password => '!LFKD%$&' ); # Access http://localhost:3000/dbviewer # Prefix change (http://localhost:3000/dbviewer2) plugin 'DBViewer', dsn => $dsn, prefix => 'dbviewer2'; # Route my $bridge = $app->route->under(sub {...}); plugin 'DBViewer', dsn => $dsn, route => $bridge;
Mojolicious::Plugin::DBViewer is Mojolicious plugin to display Database information on your browser.
Mojolicious::Plugin::DBViewer have the following features.
MySQL
and SQLite
show create table
primary keys
, null allowed columnes
, database engines
and charsets
in all tables.connector_get => \$connector
Get DBIx::Connector object internally used.
# Get database handle my $connector; plugin('DBViewer', ..., connector_get => \$connector); my $dbh = $connector->dbh;
charset => 'euc-jp'
Database charset, default is UTF-8
.
dsn => "dbi:SQLite:dbname=proj"
Datasource name.
password => 'secret';
Database password.
prefix => 'dbviewer2'
Application base path, default to dbviewer
. You can access DB viewer by the following path.
http://somehost.com/dbviewer2
footer_text => 'Web DB Viewer'
Footer text.
footer_link => 'https://github.com/yuki-kimoto/webdbviewer'
Footer link
option => $option
DBI option (DBI connect method's fourth argument).
route => $route
Router for bridge, default to $app-
routes>.
my $bridge = $r->under(sub {...}); plugin 'DBViewer', dsn => $dsn, route => $bridge;
user => 'kimoto'
site_title => 'Your DB Viewer';
Site title.
Database user.
If a feature is DEPRECATED, you can know it by DEPRECATED warnings. DEPRECATED feature is removed after five years
, but if at least one person use the feature and tell me that thing I extend one year each time he tell me it.
DEPRECATION warnings can be suppressed by MOJOLICIOUS_PLUGIN_DBVIEWER_SUPPRESS_DEPRECATION
environment variable.
EXPERIMENTAL features will be changed without warnings.
Copyright 2013 Yuki Kimoto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.