Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sql::translator::schema::object(3pm) [debian man page]

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

NAME
SQL::Translator::Schema::Object - Base class SQL::Translator Schema objects. SYNOPSIS
DESCSIPTION
Base class for Schema objects. Sub classes Class::Base and adds the following extra functionality. Construction Derived classes should declare their attributes using the "_attributes" method. They can then inherit the "init" method from here which will call accessors of the same name for any values given in the hash passed to "new". Note that you will have to impliment the accessors your self and we expect perl style methods; call with no args to get and with arg to set. e.g. If we setup our class as follows; package SQL::Translator::Schema::Table; use base qw/SQL::Translator::Schema::Object/; __PACKAGE__->_attributes( qw/schema name/ ); sub name { ... } sub schema { ... } Then we can construct it with my $table = SQL::Translator::Schema::Table->new( schema => $schema, name => 'foo', ); and init will call "$table->name("foo")" and "$table->schema($schema)" to set it up. Any undefined args will be ignored. Multiple calls to "_attributes" are cumulative and sub classes will inherit their parents attribute names. This is currently experimental, but will hopefull go on to form an introspection API for the Schema objects. Global Attributes The following attributes are defined here, therefore all schema objects will have them. extra Get or set the objects "extra" attibutes (e.g., "ZEROFILL" for MySQL fields). Call with no args to get all the extra data. Call with a single name arg to get the value of the named extra attribute, returned as a scalar. Call with a hash or hashref to set extra attributes. Returns a hash or a hashref. $field->extra( qualifier => 'ZEROFILL' ); $qualifier = $field->extra('qualifier'); %extra = $field->extra; $extra = $field->extra; remove_extra "extra" can only be used to get or set "extra" attributes but not to remove some. Call with no args to remove all extra attributes that have been set before. Call with a list of key names to remove certain extra attributes only. # remove all extra attributes $field->remove_extra(); # remove timezone and locale attributes only $field->remove_extra(qw/timezone locale/); equals Determines if this object is the same as another. my $isIdentical = $object1->equals( $object2 ); SEE ALSO
TODO
BUGS
AUTHOR
Ken Youens-Clark <kclark@cpan.org>, Mark Addison <mark.addison@itn.co.uk>. perl v5.14.2 2012-01-20 SQL::Translator::Schema::Object(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