NAME

Mojolicious::Plugin::SQLiteViewerLite - Mojolicious plugin to display SQLite database information on browser

SYNOPSYS

# Mojolicious::Lite
# (dbh is a database handle already connected to the database)
plugin 'SQLiteViewerLite', dbh => $dbh;

# Mojolicious
$app->plugin('SQLiteViewerLite', dbh => $dbh);

# Access
http://localhost:3000/sqliteviewerlite

# Prefix
plugin 'SQLiteViewerLite', dbh => $dbh, prefix => 'sqliteviewerlite2';

# Route
my $brige = $app->route->under(sub {...});
plugin 'SQLiteViewerLite', dbh => $dbh, route => $brige;

# Using connection manager object instead of "dbh"
plugin 'SQLiteViewerLite', connector => DBIx::Connector->connect(...);

# Using DBIx::Custom object instead of "dbh"
plugin 'SQLiteViewerLite', dbi => DBIx::Custom->connect(...);

DESCRIPTION

Mojolicious::Plugin::SQLiteViewerLite is Mojolicious plugin to display SQLite database information on browser.

Mojolicious::Plugin::SQLiteViewerLite have the following features.

  • Display all table names

  • Display show create table

  • Select * from TABLE

  • Display primary keys and null allowed columnes in all tables.

OPTIONS

connector

connector => $connector

Connector object such as DBIx::Connector to connect to database. You can use this instead of dbh option.

my $connector = DBIx::Connector->connect(...);

Connector has dbh method to get database handle

dbh

dbh => $dbh

dbh is a DBI database handle already connected to the database.

my $dbh = DBI->connect(...);

dbi

dbi => DBIx::Custom->connect(...);

DBIx::Custom object. you can use this instead of dbh option.

prefix

prefix => 'sqliteviewerlite2'

Application base path, default to sqliteviewerlite.

route

route => $route

Router, default to $app-routes>.

It is useful when under is used.

my $b = $r->under(sub { ... });
plugin 'SQLiteViewerLite', dbh => $dbh, route => $b;