Test::DB::Postgres
Temporary Testing Databases for Postgres
Temporary Postgres Database for Testing
method: clone method: create method: destroy
package main;
use Test::DB::Postgres;
my $tdbo = Test::DB::Postgres->new;
# my $dbh = $tdbo->create->dbh;
dbh: ro, opt, Object dsn: ro, opt, Str database: ro, opt, Str hostname: ro, opt, Str hostport: ro, opt, Str uri: ro, opt, Str username: ro, opt, Str password: ro, opt, Str
This package provides methods for generating and destroying Postgres databases for testing purposes. The attributes can be set using their respective environment variables: TESTDB_TEMPLATE, TESTDB_DATABASE, TESTDB_USERNAME, TESTDB_PASSWORD, TESTDB_HOSTNAME, and TESTDB_HOSTPORT.
The clone method creates a temporary database from a database template.
clone(Str $source) : Object
=example-1 clone
# given: synopsis
$tdbo->clone('template0');
# <Test::DB::Postgres>
The create method creates a temporary database and returns the invocant.
create() : Object
=example-1 create
# given: synopsis
$tdbo->create;
# <Test::DB::Postgres>
The destroy method destroys (drops) the database and returns the invocant.
destroy() : Object
=example-1 destroy
# given: synopsis
$tdbo->create;
$tdbo->destroy;
# <Test::DB::Postgres>
13 POD Errors
The following errors were encountered while parsing the POD:
- Around line 13:
Unknown directive: =name
- Around line 21:
Unknown directive: =tagline
- Around line 29:
Unknown directive: =abstract
- Around line 37:
Unknown directive: =includes
- Around line 47:
Unknown directive: =synopsis
- Around line 59:
Unknown directive: =attributes
- Around line 74:
Unknown directive: =description
- Around line 84:
Unknown directive: =method
- Around line 88:
Unknown directive: =signature
- Around line 102:
Unknown directive: =method
- Around line 106:
Unknown directive: =signature
- Around line 120:
Unknown directive: =method
- Around line 124:
Unknown directive: =signature