SQL::OOP::Array - An Abstract class for any combination of snippets
my $array = SQL::OOP::Array->new(@elements); my $sql = $array->to_string; my @bind = $array->bind;
This is an abstract class which represents array of SQL snippets.
This class inherits all methods from SQL::OOP::Base. Some of them is overridden.
Constructor. Since this class is an abstract, you may not have to call this directly.
SQL::OOP::Array->new('elem1', 'elem2', 'elem3'); # elem1 elem2 elem3
Arguments can be SQL::OOP::Base instances.
my $elem1 = SQL::OOP::Base->new('elem1'); my $elem2 = SQL::OOP::Base->new('elem2'); my $elem3 = SQL::OOP::Base->new('elem3'); SQL::OOP::Array->new($elem1, $elem2, $elem3); # elem1 elem2 elem3
This method appends elements to the instance and returns $self. This method takes same arguments as new constructor.
This sets separator string such as ' AND ', ' OR '.
This method corrects all children's bind values and returns all together.
This method generates SQL. This is called inside to_string so don't call it directly. This method internally corrects all children's to_string results and join them with separator.
Retrieve values into array.
This method is internally called by generate method to parenthesizes the SQL on list context.
Sugama Keita, <email@example.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.