DESCRIPTION

Slovo::Plugin::MojoDBx allows you to switch from using one Mojo database adaptor to another without having to change your database helper name or just about any code in your application as long as Mojo::Pg, Mojo::mysql, Mojo::SQLite or Mojo::WhateverDB have compatible APIs. Currently this plugin is part of Slovo, but it can be easily moved to the Mojo::Plugin namespace if there is positive feedback about that.

CONFIGURATION

The folowing options are currently supported. They basically get the data needed for the most common steps of setting up database adaptors in Mojolicious.

adaptor

The specific part of the name of a known database adaptor - SQLite for Mojo::SQLite, Pg for Mojo::Pg, etc. This adaptor will be loaded via "load_class" in Mojo::Loader.

adaptor_attributes

Array reference of hash references. See "ATTRIBUTES" in Mojo::Pg. Keys will be called as setters and the values will be passed as arguments.

migration_files

Array reference of full paths to files which will be used for migrations.

new

Mandatory. Anything that the constructor would accept.

on_connection

Array of SQL statements or code referneces. Some Perl or SQL code which you want to execute every time the application conects to the database. See "SYNOPSIS".

sql_debug

This plugin uses "Callbacks" in DBI to log the produced SQL for debugging purposes. A positive integer is used for "caller" in perlfunc to report which method produced this SQL. A value of 0 disables SQL debugging and usually 4 and above is useful. The value is the number of callframes to skip when reporting the calling subroutine.

tables

Tables for which to be generated helpers. Each table name becomes a helper. (e.g. users becomes $c->users ot $app->users).

AUTHOR

Красимир Беров
CPAN ID: BEROV
berov ат cpan точка org
http://i-can.eu

COPYRIGHT

This program is free software licensed under the Artistic License 2.0.

The full text of the license can be found in the LICENSE file included with this module.

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.