SQL::OOP::IDArray - ID arrays for SQL
### field my $field = SQL::OOP::ID->new(@path_to_field); $field->to_string # e.g. "tbl"."col" ### from my $from = SQL::OOP::ID->new(@path_to_table); $from->to_string # e.g. "schema"."tbl" ### IDArray my $fields = SQL::OOP::IDArray->new($field1, $field2); $fields->to_string # e.g. "schema"."tbl1", "schema"."tbl2"
This module provides a class SQL::OOP::IDArray which represents ID array.
This class represents ID arrays such as field lists in SELECT or table lists in FROM clause. This class inherits SQL::OOP::Array class.
my $id_list = SQL::OOP::IDArray->new('tbl1', 'tbl2', 'tbl3'); $id_list->to_string; # "tbl1", "tbl2", "tbl3"
Here is some examples.
my $id_obj1 = SQL::OOP::ID->new('public', 'tbl1'); my $id_obj2 = SQL::OOP::ID->new('public', 'tbl2'); my $id_obj3 = SQL::OOP::ID->new('public', 'tbl3'); my $id_list = SQL::OOP::IDArray->new($id_obj1, $id_obj2, $id_obj3); $id_list->to_string; # "public"."tbl1", "public"."tbl2", "public"."tbl3"
Appends elements into existing instance.
This method is internally called by generate method to parenthesizes the SQL on list context.
Sugama Keita, <sugama@jamadam.com>
Copyright (C) 2011 by Sugama Keita.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install SQL::OOP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SQL::OOP
CPAN shell
perl -MCPAN -e shell install SQL::OOP
For more information on module installation, please visit the detailed CPAN module installation guide.