NAME

Mojolicious::Plugin::DbicSchemaViewer - Viewer for DBIx::Class schema definitions

Requires Perl 5.20+ Travis status

VERSION

Version 0.0100, released 2015-10-28.

SYNOPSIS

$self->plugin(DbicSchemaViewer => {
    schema => Your::Schema->connect(...),
});

DESCRIPTION

This plugin is viewer for DBIx::Class schemas. It lists all ResultSources with column definitions and and their relationships. See examples/example.html for an example.

Configuration

The following settings are available. It is recommended to use either router or condition to place the viewer behind some kind of authorization check.

schema

Mandatory.

Should be an instance of an DBIx::Class::Schema class.

url

Optional.

By default, the viewer is located at /dbic-schema-viewer.

router

Optional. Can not be used together with condition.

Use this when you which to place the viewer behind an under route:

my $secure = $app->routes->under('/secure' => sub {
    my $c = shift;
    return defined $c->session('logged_in') ? 1 : 0;
});

$self->plugin(DbicSchemaViewer => {
    router => $secure,
    schema => Your::Schema->connect(...),
});

Now the viewer would be located, if the check is successful, at /secure/dbic-schema-viewer.

condition

Optional. Can not be used together with router.

Use this when you have a named condition you which to place the viewer behind:

$self->routes->add_condition(random => sub { return !int rand 4 });

$self->plugin(DbicSchemaViewer => {
    condition => 'random',
    schema => Your::Schema->connect(...),
});

SOURCE

https://github.com/Csson/p5-Mojolicious-Plugin-DbicSchemaViewer

HOMEPAGE

https://metacpan.org/release/Mojolicious-Plugin-DbicSchemaViewer

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Erik Carlsson <info@code301.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.