DBIx-TempDB

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    DBIx::TempDB - Create a temporary database

VERSION
    0.14

SYNOPSIS
      use Test::More;
      use DBIx::TempDB;
      use DBI;

      # provide credentials with environment variables
      plan skip_all => 'TEST_PG_DSN=postgresql://postgres@localhost' unless $ENV{TEST_PG_DSN};

      # create a temp database
      my $tmpdb = DBIx::TempDB->new($ENV{TEST_PG_DSN});

      # print complete url to db server with database name
      diag $tmpdb->url;

      # useful for reading in fixtures
      $tmpdb->execute("create table users (name text)");

README.md  view on Meta::CPAN

# VERSION

0.16

# SYNOPSIS

    use Test::More;
    use DBIx::TempDB;
    use DBI;

    # provide credentials with environment variables
    plan skip_all => 'TEST_PG_DSN=postgresql://postgres@localhost' unless $ENV{TEST_PG_DSN};

    # create a temp database
    my $tmpdb = DBIx::TempDB->new($ENV{TEST_PG_DSN});

    # print complete url to db server with database name
    diag $tmpdb->url;

    # useful for reading in fixtures
    $tmpdb->execute("create table users (name text)");

lib/DBIx/TempDB.pm  view on Meta::CPAN

=head1 VERSION

0.16

=head1 SYNOPSIS

  use Test::More;
  use DBIx::TempDB;
  use DBI;

  # provide credentials with environment variables
  plan skip_all => 'TEST_PG_DSN=postgresql://postgres@localhost' unless $ENV{TEST_PG_DSN};

  # create a temp database
  my $tmpdb = DBIx::TempDB->new($ENV{TEST_PG_DSN});

  # print complete url to db server with database name
  diag $tmpdb->url;

  # useful for reading in fixtures
  $tmpdb->execute("create table users (name text)");



( run in 0.243 second using v1.01-cache-2.11-cpan-4d50c553e7e )