Mojolicious::Plugin::DBViewer - Mojolicious plugin to display database information on browser
This module is alpha release. features will be changed without warnings.
# 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', dbh => $dbh, prefix => 'dbviewer2'; # Route my $bridge = $app->route->under(sub {...}); plugin 'DBViewer', route => $bridge, ...;
Mojolicious::Plugin::DBViewer is Mojolicious plugin to display Database information on your browser.
Mojolicious::Plugin::DBViewer have the following features.
Support MySQL and SQLite
MySQL
SQLite
Display all table names
Display show create table
show create table
Execute simple select statement
Display primary keys, null allowed columnes, database engines and charsets in all tables.
primary keys
null allowed columnes
database engines
charsets
connector_get => \$connector
Get DBIx::Connector object internally used.
# Get database handle my $connector; plugin('DBViewer', ..., connector_get => \$connector); my $dbh = $connector->dbh;
default_charset => 'euc-jp'
Default charset, default is UTF-8.
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.
dbviewer
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, default to $app-routes>.
$app-
It is useful when under is used.
under
my $bridge = $r->under(sub {...}); plugin 'DBViewer', dbh => $dbh, 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.
five years
DEPRECATION warnings can be suppressed by MOJOLICIOUS_PLUGIN_DBVIEWER_SUPPRESS_DEPRECATION environment variable.
MOJOLICIOUS_PLUGIN_DBVIEWER_SUPPRESS_DEPRECATION
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.
To install Mojolicious::Plugin::DBViewer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::DBViewer
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::DBViewer
For more information on module installation, please visit the detailed CPAN module installation guide.