From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

DBIx::QuickDB - Quickly start a db server.

DESCRIPTION

This library makes it easy to spin up a temporary database server for any supported driver. PostgreSQL, MySQL and SQLite are the initially supported drivers.

SYNOPSIS

These are nearly identical, creating databases that can be retrieved by name globally. The difference is that the first will build them at compile-time and will provide constants for accessing them. The second will build them at run-time and you have to store them in variables.

DB CONSTANTS

use DBIx::QuickDB MYSQL_DB => {driver => 'MySQL'};
use DBIx::QuickDB PSQL_DB  => {driver => 'PostgreSQL'};

my $m_dbh = MYSQL_DB->connect;
my $p_dbh = PSQL_DB->connect;

...

DB ON THE FLY

use DBIx::QuickDB;

my $msql = DBIx::QuickDB->build_db(mysql_db => {driver => 'MySQL'});
my $psql = DBIx::QuickDB->build_db(pg_db => {driver => 'PostgreSQL'});

my $m_dbh = $msql->connect;
my $p_dbh = $psql->connect;

...

ENV VARS

METHODS

SPEC HASH

Here is an overview of all options allowed:

my %spec = (
    autostart => BOOL,
    autostop  => BOOL,
    bootstrap => BOOL,
    cleanup   => BOOL,
    dir       => PATH,
    driver    => DRIVER_NAME,
    drivers   => ARRAYREF,
    load_sql  => FILE_OR_HASH,
    nocache   => BOOL,
);

SOURCE

The source code repository for DBIx-QuickDB can be found at https://github.com/exodist/DBIx-QuickDB/.

MAINTAINERS

AUTHORS

COPYRIGHT

Copyright 2020 Chad Granum exodist7@gmail.com.

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

See http://dev.perl.org/licenses/