DB::Object::Mysql::Query - Query Object for MySQL
use DB::Object::Mysql::Query; my $this = DB::Object::Mysql::Query->new || die( DB::Object::Mysql::Query->error, "\n" );
v0.3.8
This is a MySQL specific query object.
Sets or gets the array object (Module::Generic::Array) for the binded value in HAVING clauses.
HAVING
This takes the parameters bind and value and returns a formatted FROM_UNIXTIME expression.
FROM_UNIXTIME
This takes the parameters bind, value and quote and returns a formatted expression to returns the epoch value out of the given field: UNIX_TIMESTAMP
UNIX_TIMESTAMP
Calls "_where_having" in DB::Object::Query to build a having clause.
having
Build a new DB::Object::Query::Clause clause object by calling "_process_limit" and return it.
This method can take either 1 parameter which would then be a DB::Object::Statement object, or it can also be an hash reference of options.
It can alternatively take an hash of options.
If a statement was provided, it will be stringified calling "as_string" in DB::Object::Statement and used as a select query in the replace statement.
replace
When preparing the replace query, this will be mindful to avoid fields that are null by default and not provided among the options.
null
If called in void context, this will execute the prepared statement immediately.
It returns the prepared statement handler (DB::Object::Statement).
If the object property query_reset is not already set, this will remove the following properties from the current query object, set "enhance" in DB::Object::Query to true and return the query object.
query_reset
Properties removed are: alias local binded binded_values binded_where binded_limit binded_group binded_having binded_order where limit group_by order_by reverse from_unixtime unix_timestamp sorted
Reset all the following object properties to an anonymous array: binded binded_where binded_group binded_having binded_order binded_limit
This is called by the various query methods like "select" in DB::Object::Query, "insert" in DB::Object::Query, "update" in DB::Object::Query, "delete" in DB::Object::Query
It will get the various query components (group, having, sort, order, limit) that have been set and add them formatted to an array that is returned.
This version of "_query_components" exists here to provide MySQL specific implementation. See also the generic one in "_query_components" in DB::Object::Query
perl
Jacques Deguest <jack@deguest.jp>
Copyright (c) 2019-2021 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install DB::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Object
CPAN shell
perl -MCPAN -e shell install DB::Object
For more information on module installation, please visit the detailed CPAN module installation guide.