DB::Object::Mysql::Query - Statement Object for MySQL
use DB::Object::Mysql::Statement; my $this = DB::Object::Mysql::Statement->new || die( DB::Object::Mysql::Statement->error, "\n" );
v0.300.1
This is a MySQL specific statement object.
This takes no argument and this will modify the query to add the keyword DISTINCT
DISTINCT
$sth->distinct; # produces SELECT DISTINCT.... $sth->distinct( 'name' ); # produces SELECT DISTINCT ON (name)....
If called in void context, this will execute the prepare statement handler immediately.
It returns the newly created statement handler.
See MySQL documentation for more information
This will dump the result of the query to STDOUT or to a file if file argument is provided, or if a filehandle is provided with fh, it will be used to print out the data.
It takes also a vsep, which defaults to a command and a hsep which defaults to a new line.
It returns the current object.
This takes no argument and this will modify the queries of type alter, insert, update to add the keyword IGNORE
alter
insert
update
IGNORE
$sth->ignore; # produces INSERT IGNORE....
This returns an error as SELECT FROM ONLY is not supported by MySQL.
SELECT FROM ONLY
Provided with a priority integer that can be 0 or 1 with 0 being LOW_PRIORITY and 1 being HIGH_PRIORITY and this will adjust the query formatted to add the priority. This works only on Mysql drive though.
LOW_PRIORITY
HIGH_PRIORITY
If used on queries other than DELETE, INSERT, REPLACE, SELECT, UPDATE an error will be returned.
DELETE
INSERT
REPLACE
SELECT
UPDATE
If called in void context, this will execute the newly create statement handler immediately.
It returns the newly create statement handler.
$sth->wait || die( $sth->error );
This takes no parameter and only works on queries of type INSERT or UPDATE. It will modify the previously prepared query to add the keyword DELAYED
DELAYED
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.