SQL::Entity::Table - Database table abstraction
use SQL::Entity::Table; use'SQL::Entity::Column ':all'; my $table = SQL::Entity::Table->new( name => 'emp' columns => [sql_column(name => 'empno')] ); my ($sql) = $table->query; my $dept = SQL::Entity->new( name => 'dept', alias => 'd', columns => [ sql_column(name => 'deptno'), sql_column(name => 'dname') ], ); my $emp = SQL::Entity->new( name => 'emp', primary_key => ['empno'], columns => [ sql_column(name => 'ename'), sql_column(name => 'empno'), sql_column(name => 'deptno') ], ); $emp->add_to_one_relationships(sql_relationship( table => $dept, condition => sql_cond($dept->column('deptno'), '=', $entity->column('deptno')) ));
Represents database table definition.
None.
all - exports sql_column method
Table schema name
Index name that will be used to enforce order of the result.
Returns list of unique columns
Returns sql statement and bind variables, Takes optionally array ref of the requeted columns, condition object, bind_variables reference
Retiurn sql and bind variables that returns number of rows for passed in condition,
Returns "FROM .... " SQL fragment
Returns FROM operand " table1 " SQL fragment
Returns table alias
Returns " SELECT ..." SQL fragment
Returns list of column that can be used in select clause
Returns list of column that can be used in insert clause
Returns list of column that can be used in update clause
Returns hash_ref with all columns that belongs to this object.
Returns " WHERE ..." SQL fragment
Returns order_index object, if order_index is not set then the first index will be seleted.
Return hinst cluase that will be placed as SELECT operand
Returns " ORDER BY ..." SQL fragment
SQL::Query SQL::Entity SQL::Entity::Column
The SQL::Entity::Table module is free software. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
Adrian Witas, adrian@webapp.strefa.pl
To install SQL::Entity, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::Entity
CPAN shell
perl -MCPAN -e shell install SQL::Entity
For more information on module installation, please visit the detailed CPAN module installation guide.