- COPYRIGHT AND LICENSE
Pg::CLI::createdb - Wrapper for the createdb utility
my $createdb = Pg::CLI::createdb->new( username => 'foo', password => 'bar', host => 'pg.example.com', port => 5433, ); $createdb->run( database => 'NewDB', options => [ '--encoding', 'UTF-8', '--owner', 'alice', ], );
This class provides a wrapper for the createdb utility.
This class provides the following methods:
The constructor accepts a number of parameters:
The path to createdb. By default, this will look for createdb in your path and throw an error if it cannot be found.
The username to use when connecting to the database. Optional.
The password to use when connecting to the database. Optional.
The host to use when connecting to the database. Optional.
The port to use when connecting to the database. Optional.
If this is true, then the
PGSSLMODEenvironment variable will be set to "require" when connecting to the database.
This method runs the createdb command with the given options.
This method also accepts optional
stderr parameters. These parameters can be any defined value that could be passed as the relevant parameter to IPC::Run3's
Most notably, you can pass scalar references to pipe data in via the
stdin parameter or capture output sent to
This method accepts the following arguments:
The name of the database to create. Required.
A list of additional options to pass to the command. Optional.
Bugs may be submitted at http://rt.cpan.org/Public/Dist/Display.html?Name=Pg-CLI or via email to firstname.lastname@example.org.
I am also usually active on IRC as 'autarch' on
The source code repository for Pg-CLI can be found at https://github.com/houseabsolute/Pg-CLI.
Dave Rolsky <email@example.com>
This software is Copyright (c) 2018 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
The full text of the license can be found in the LICENSE file included with this distribution.