Dave Rolsky > Pg-CLI-0.07 > Pg::CLI::psql

Download:
Pg-CLI-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.07   Source   Latest Release: Pg-CLI-0.11

NAME ^

Pg::CLI::psql - Wrapper for the psql utility

VERSION ^

version 0.07

SYNOPSIS ^

  my $psql = Pg::CLI::psql->new(
      username => 'foo',
      password => 'bar',
      host     => 'pg.example.com',
      port     => 5433,
  );

  $psql->run(
      database => 'database',
      options  => [ '-c', 'DELETE FROM table' ],
  );

  $psql->execute_file(
      database => 'database',
      file     => 'thing.sql',
  );

DESCRIPTION ^

This class provides a wrapper for the psql utility.

METHODS ^

This class provides the following methods:

Pg::CLI::psql->new( ... )

The constructor accepts a number of parameters:

$psql->run( database => ..., options => [ ... ] )

This method runs a command against the specified database. You must pass one or more options that indicate what psql should do.

$psql->execute_file( database => ..., file => ... )

This method executes the specified file against the database. You can also pass additional options via the options parameter.

$psql->version()

Returns a the three part version as a string.

$psql->two_part_version()

Returns the first two decimal numbers in the version.

BUGS ^

See Pg::CLI for bug reporting details.

AUTHOR ^

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE ^

This software is Copyright (c) 2010 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0
syntax highlighting: