André Rivotti Casimiro > SQL-QueryBuilder-Pretty > SQL::QueryBuilder::Pretty::Print

Download:
SQL-QueryBuilder-Pretty-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

SQL::QueryBuilder::Pretty::Print - Query construction object for SQL::QueryBuilder::Pretty's rules.

VERSION ^

Version 0.01

SYNOPSIS ^

    use SQL::QueryBuilder::Pretty::Print;

    my $print = SQL::QueryBuilder::Pretty::Print->new(
        '-indent_ammount' => 4,
        '-indent_char'    => ' ',
        '-new_line'       => "\n",
    );

    $print->var('SELECT');
    $print->new_line;
    $print->indent(2);

    $print->var('*');
    $print->new_line;
    $print->unindent;
    
    $print->var('FROM');
    $print->new_line;
    $print->indent;

    $print->var('table_name`;');

DESCRIPTION ^

Query construction object for SQL::QueryBuilder::Pretty's rules.

METHODS

PACKAGE->new(%options)

Initializes the object. See OPTIONS.

$obj->current_indent

Returns the current indentation spaces.

$obj->indent([$multiplier])

Increase the indentation level by 1 * $multiplier and appends the current indentation to the query. If no $multiplier is given it uses 1.

$obj->indent_ammount

Returns the '-indent_amount' option value.

$obj->indent_char

Returns the '-indent_char' option value.

$obj->indent_level([$add])

Retturns the current indent level. Add $add to the indent level if set.

$obj->indent_multiplier([$new_value])

Returns the current indent multiplier. Sets indent multiplier to $new_value if set;

$obj->new_line

Appends a new line to the query.

$obj->query

Returns the constructed query.

$obj->unindent([$multiplier])

Decrease the indentation level by 1 * $multiplier and appends the current indentation to the query. If no $multiplier is given it uses 1.

$obj->var($value);

Appends $value to the query.

$obj->skip_next_space([0|1])

Returns/sets skip next space variable.

OPTIONS

-indent_amount

The number of time '-indent_char' is repeated for each indentation. Default is 4.

-indent_char

Indent char used. Default is ' '.

-new_line

New line char used. default is "\n",

SEE ALSO ^

SQL::QueryBuilder::Pretty and SQL::QueryBuilder::Pretty::Rule.

AUTHOR ^

André Rivotti Casimiro, <rivotti at cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009 by André Rivotti Casimiro. Published under the terms of the Artistic License 2.0.

syntax highlighting: