NAME
Mojo::Hakkefuin - Abstraction for Mojolicious::Plugin::Hakkefuin
SYNOPSIS
use Mojo::Hakkefuin;
# SQLite as backend
my $mhf = Mojo::Hakkefuin->new;
my $mhf = Mojo::Hakkefuin->new({ dir => '/path/location/migrations' });
# MariaDB/MySQL as backend
my $mhf = Mojo::Hakkefuin->new({
via => 'mariadb',
dsn => 'mariadb://username:password@hostname/database'
});
# PostgreSQL as backend
my $mhf = Mojo::Hakkefuin->new({
via => 'pg',
dsn => 'postgresql://username:password@hostname/database'
});
DESCRIPTION
General abstraction for Mojolicious::Plugin:::Hakkefuin. By defaults using Mojo::SQLite as backend storage.
ATTRIBUTES
Mojo::Hakkefuin inherits all attributes from Mojo::Base and implements the following new ones.
via
$mhf->via;
$mhf->via('mariadb');
$mhf->via('sqlite');
$mhf->via('pg');
Specify of backend via MariaDB/MySQL or SQLite or PostgreSQL. This attribute by default contains sqlite.
dsn
$mhf->dsn;
$mhf->dsn('mariadb://username:password@hostname/database');
$mhf->dsn('postgresql://username:password@hostname/database');
Determine DSN (Data Source Name) based on the DBMS that will be used. E.g. MariaDB/MySQL or PostgreSQL. Especially for SQLite, you don't need to use dsn.
dir
$mhf->dir;
$mhf->dir('for/specific/dir/name');
This attribute by default contains migrations and is automatically created and saved to the application directory. Specify the migration storage directory for Mojo::Hakkefuin configuration file. If the backend storage uses sqlite, then the file will be saved into a directory set via this attribute.
METHODS
Mojo::Hakkefuin inherits all methods from Mojo::Base and implements the following new ones.
check_file_migration
$mhf->check_file_migration();
Checking file migration on your application directory.
check_migration
$mhf->check_migration();
Checking migration database storage.
new()
my $mhf = Mojo::Hakkefuin->new;
my $mhf = Mojo::Hakkefuin->new(\%attr);
Construct a new Mojo::Hakkefuin object either from "ATTRIBUTES".