NAME

Bigtop::ScriptHelp::Style::PgLive - gets its descriptions from Postgresql

SYNOPSIS

For normal use:

bigtop -n AppName -s Pg8Live 'dbi:Pg:dbname=yourdb' user pass [schema]

Do the same for tentmaker. It also works for -a:

bigtop -a docs/app.bigtop \
    -s Pg8Live 'dbi:Pg:dbname=yourdb' user pass [schema]

Only tables not in docs/app.bigtop will be affected.

For use in scripts:

use Bigtop::ScriptHelp::Style;

my $style = Bigtop::ScriptHelp::Style->get_style( 'PgLive' );

# then pass $style to methods of Bigtop::ScriptHelp

DESCRIPTION

See Bigtop::ScriptHelp::Style for a description of what this module must do in general.

This module pulls the database layout from the supplied database. It makes queries on internal postgres tables to retrieve its data. The queries are probably specific to postgres 8.x. They may work for earlier versions, but I wouldn't want to put any money down on that.

This module pulls these things from the database whose dsn you supply:

  • table names

  • column names

  • SQL type of each column

  • primary keys

  • column default values

  • foreign keys

METHODS

get_db_layout

This method does not use standard in. Instead, it expects these command line arguments (in order):

dsn

Suitable for handing to DBI->connect. Example:

dbi:Pg:dbname=yourdb
database user
password for user
(optional) schema

Defaults to 'public.' Use this if you need to bring in tables from one schema. There is no support for handling multiple schemas with a single invocation, but there is no rule against rerunning with the -a flag to bring in others.

AUTHOR

Phil Crow, <crow.phil@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2007, Phil Crow

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.