GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Test2::Tools::QuickDB(3) User Contributed Perl Documentation Test2::Tools::QuickDB(3)

Test2::Tools::QuickDB - Quickly spin up temporary Database servers for tests.

This is a test library build around DBIx::QuickDB.

    use Test2::V0 -target => DBIx::QuickDB::Driver::PostgreSQL;
    use Test2::Tools::QuickDB;

    skipall_unless_can_db(driver => 'PostgreSQL');

    my $db = get_db(driver => 'PostgreSQL', load_sql => 't/schema/postgresql.sql'});

    ...

$driver = skipall_unless_can_db('MyDriver')
$driver = skipall_unless_can_db(['MyDriver', 'OurDriver'])
$driver = skipall_unless_can_db(%spec)
This will look for a usable driver. If no usable driver is found, this will issue a skip_all to skip the current test or subtest. If at least one suable driver is found then the first one found will be returned.

If you pass in 1 argument it should either be a driver to try, or an arrayref of drivers to try.

If you passing multiple argument then you should follow the specifications in "SPEC HASH" in DBIx::QuickDB.

Feel free to ignore the return value.

$db = get_db
$db = get_db($name)
$db = get_db(\%spec)
$db = get_db($name, \%spec)
$db = get_db $name => \%spec
Get a database.

With no arguments it will give you an instance of the first working driver it finds.

You can provide a name for the db, the same instance can then be retrieved anywhere GLOBALLY using the same name.

You can provide a spec hashref which can contain any arguments documented in "SPEC HASH" in DBIx::QuickDB.

$db = get_db_or_skipall $name => \%spec
$db = get_db_or_skipall($name, \%spec)
$db = get_db_or_skipall($name)
$db = get_db_or_skipall(\%spec)
This combines "get_db()" and "skipall_unless_can_db()". The arguments supported are identical to "get_db()".

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

Chad Granum <exodist@cpan.org>

Chad Granum <exodist@cpan.org>

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/

2021-01-19 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.