Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sql::abstract::tree(3pm) [debian man page]

SQL::Abstract::Tree(3pm)				User Contributed Perl Documentation				  SQL::Abstract::Tree(3pm)

NAME
SQL::Abstract::Tree - Represent SQL as an AST SYNOPSIS
my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' }); print $sqla_tree->format('SELECT * FROM foo WHERE foo.a > 2'); # SELECT * # FROM foo # WHERE foo.a > 2 METHODS
new my $sqla_tree = SQL::Abstract::Tree->new({ profile => 'console' }); $args = { profile => 'console', # predefined profile to use (default: 'none') fill_in_placeholders => 1, # true for placeholder population placeholder_surround => # The strings that will be wrapped around [GREEN, RESET], # populated placeholders if the above is set indent_string => ' ', # the string used when indenting indent_amount => 2, # how many of above string to use for a single # indent level newline => " ", # string for newline colormap => { select => [RED, RESET], # a pair of strings defining what to surround # the keyword with for colorization # ... }, indentmap => { select => 0, # A zero means that the keyword will start on # a new line from => 1, # Any other positive integer means that after on => 2, # said newline it will get that many indents # ... }, } Returns a new SQL::Abstract::Tree object. All arguments are optional. profiles There are four predefined profiles, "none", "console", "console_monochrome", and "html". Typically a user will probably just use "console" or "console_monochrome", but if something about a profile bothers you, merely use the profile and override the parts that you don't like. format $sqlat->format('SELECT * FROM bar WHERE x = ?', [1]) Takes $sql and "@bindargs". Returns a formatting string based on the string passed in parse $sqlat->parse('SELECT * FROM bar WHERE x = ?') Returns a "tree" representing passed in SQL. Please do not depend on the structure of the returned tree. It may be stable at some point, but not yet. unparse $sqlat->parse($tree_structure, @bindargs) Transform "tree" into SQL, applying various transforms on the way. format_keyword $sqlat->format_keyword('SELECT') Currently this just takes a keyword and puts the "colormap" stuff around it. Later on it may do more and allow for coderef based transforms. pad_keyword my ($before, $after) = @{$sqlat->pad_keyword('SELECT')}; Returns whitespace to be inserted around a keyword. fill_in_placeholder my $value = $sqlat->fill_in_placeholder(@bindargs) Removes last arg from passed arrayref and returns it, surrounded with the values in placeholder_surround, and then surrounded with single quotes. indent Returns as many indent strings as indent amounts times the first argument. ACCESSORS
colormap See "new" fill_in_placeholders See "new" indent_amount See "new" indent_string See "new" indentmap See "new" newline See "new" placeholder_surround See "new" perl v5.10.1 2010-12-21 SQL::Abstract::Tree(3pm)

Check Out this Related Man Page

SQL::Translator::Schema::Procedure(3pm) 		User Contributed Perl Documentation		   SQL::Translator::Schema::Procedure(3pm)

NAME
SQL::Translator::Schema::Procedure - SQL::Translator procedure object SYNOPSIS
use SQL::Translator::Schema::Procedure; my $procedure = SQL::Translator::Schema::Procedure->new( name => 'foo', sql => 'CREATE PROC foo AS SELECT * FROM bar', parameters => 'foo,bar', owner => 'nomar', comments => 'blah blah blah', schema => $schema, ); DESCRIPTION
"SQL::Translator::Schema::Procedure" is a class for dealing with stored procedures (and possibly other pieces of nameable SQL code?). METHODS
new Object constructor. my $schema = SQL::Translator::Schema::Procedure->new; parameters Gets and set the parameters of the stored procedure. $procedure->parameters('id'); $procedure->parameters('id', 'name'); $procedure->parameters( 'id, name' ); $procedure->parameters( [ 'id', 'name' ] ); $procedure->parameters( qw[ id name ] ); my @parameters = $procedure->parameters; name Get or set the procedure's name. $procedure->name('foo'); my $name = $procedure->name; sql Get or set the procedure's SQL. $procedure->sql('select * from foo'); my $sql = $procedure->sql; order Get or set the order of the procedure. $procedure->order( 3 ); my $order = $procedure->order; owner Get or set the owner of the procedure. $procedure->owner('nomar'); my $sql = $procedure->owner; comments Get or set the comments on a procedure. $procedure->comments('foo'); $procedure->comments('bar'); print join( ', ', $procedure->comments ); # prints "foo, bar" schema Get or set the procedures's schema object. $procedure->schema( $schema ); my $schema = $procedure->schema; equals Determines if this procedure is the same as another my $isIdentical = $procedure1->equals( $procedure2 ); AUTHORS
Ken Youens-Clark <kclark@cshl.org>, Paul Harrington <Paul-Harrington@deshaw.com>. perl v5.14.2 2012-01-18 SQL::Translator::Schema::Procedure(3pm)
Man Page