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


Manual Reference Pages  -  TEST::POSTGRESQL (3)

.ds Aq ’

NAME

Test::postgresql - postgresql runner for tests

CONTENTS

SYNOPSIS



  use DBI;
  use Test::postgresql;
  use Test::More;
 
  my $pgsql = Test::postgresql->new()
      or plan skip_all => $Test::postgresql::errstr;
 
  plan tests => XXX;
 
  my $dbh = DBI->connect($pgsql->dsn);



DESCRIPTION

Test::postgresql automatically setups a postgresql instance in a temporary directory, and destroys it when the perl script exits.

FUNCTIONS

    new

Create and run a postgresql instance. The instance is terminated when the returned object is being DESTROYed. If required programs (initdb and postmaster) were not found, the function returns undef and sets appropriate message to $Test::postgresql::errstr.

    base_dir

Returns directory under which the postgresql instance is being created. The property can be set as a parameter of the new function, in which case the directory will not be removed at exit.

    initdb

    postmaster

Path to initdb and postmaster which are part of the postgresql distribution. If not set, the programs are automatically searched by looking up $PATH and other prefixed directories.

    initdb_args

    postmaster_args

Arguments passed to initdb and postmaster. Following example adds --encoding=utf8 option to initdb_args.



  my $pgsql = Test::postgresql->new(
      initdb_args
          => $Test::postgresql::Defaults{initdb_args} .  --encoding=utf8
  ) or plan skip_all => $Test::postgresql::errstr;



    dsn

Builds and returns dsn by using given parameters (if any). Default username is ’postgres’, and dbname is ’test’ (an empty database).

    pid

Returns process id of postgresql (or undef if not running).

    port

Returns TCP port number on which postmaster is accepting connections (or undef if not running).

    start

Starts postmaster.

    stop

Stops postmaster.

    setup

Setups the postgresql instance.

AUTHOR

Kazuho Oku

THANKS TO

HSW

COPYRIGHT

Copyright (C) 2009 Cybozu Labs, Inc.

LICENSE

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

See <http://www.perl.com/perl/misc/Artistic.html>

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


perl v5.20.3 TEST::POSTGRESQL (3) 2009-10-23

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