DOKK / manpages / debian 12 / libalzabo-perl / Alzabo::SQLMaker::MySQL.3pm.en
Alzabo::SQLMaker::MySQL(3pm) User Contributed Perl Documentation Alzabo::SQLMaker::MySQL(3pm)

Alzabo::SQLMaker::MySQL - Alzabo SQL making class for MySQL

  use Alzabo::SQLMaker;
  my $sql = Alzabo::SQLMaker->new( sql => 'MySQL' );

This class implementes MySQL-specific SQL creation. MySQL does not allow subselects. Any attempt to use a subselect (by passing an "Alzabo::SQMaker" object in as parameter to a method) will result in an "Alzabo::Exception::SQL" error.

Almost all of the functionality inherited from Alzabo::SQLMaker is used as is. The only overridden methods are "limit()" and "get_limit()", as MySQL does allow for a "LIMIT" clause in its SQL.

SQL may be imported by name or by tags. They take arguments as documented in the MySQL documentation (version 3.23.39). The functions (organized by tag) are:

 PI
 RAND
 MOD
 ROUND
 POW
 POWER
 ATAN2
 ABS
 SIGN
 FLOOR
 CEILING
 EXP
 LOG
 LOG10
 SQRT
 COS
 SIN
 TAN
 ACOS
 ASIN
 ATAN
 COT
 DEGREES
 RADIANS
 TRUNCATE

 CHAR
 POSITION
 INSTR
 LEFT
 RIGHT
 FIND_IN_SET
 REPEAT
 LEAST
 GREATEST
 CONCAT
 ELT
 FIELD
 MAKE_SET
 LOCATE
 SUBSTRING
 CONV
 LPAD
 RPAD
 MID
 SUBSTRING_INDEX
 REPLACE
 CONCAT_WS
 EXPORT_SET
 INSERT
 ASCII
 ORD
 BIN
 OCT
 HEX
 LENGTH
 OCTET_LENGTH
 CHAR_LENGTH
 CHARACTER_LENGTH
 TRIM
 LTRIM
 RTRIM
 SOUNDEX
 SPACE
 REVERSE
 LCASE
 LOWER
 UCASE
 UPPER

 CURDATE
 CURRENT_DATE
 CURTIME
 CURRENT_TIME
 NOW
 SYSDATE
 CURRENT_TIMESTAMP
 UNIX_TIMESTAMP
 WEEK
 PERIOD_ADD
 PERIOD_DIFF
 DATE_ADD
 DATE_SUB
 ADDDATE
 SUBDATE
 DATE_FORMAT
 TIME_FORMAT
 FROM_UNIXTIME
 DAYOFWEEK
 WEEKDAY
 DAYOFYEAR
 MONTH
 DAYNAME
 MONTHNAME
 QUARTER
 YEAR
 YEARWEEK
 HOUR
 MINUTE
 SECOND
 TO_DAYS
 FROM_DAYS
 SEC_TO_TIME
 TIME_TO_SEC

These are functions which operate on an aggregate set of values all at once.

 COUNT
 AVG
 MIN
 MAX
 SUM
 STD
 STDDEV

These are functions which return information about the MySQL server.

 DATABASE
 USER
 SYSTEM_USER
 SESSION_USER
 VERSION
 CONNECTION_ID
 LAST_INSERT_ID
 GET_LOCK
 RELEASE_LOCK
 BENCHMARK
 MASTER_POS_WAIT

These are flow control functions:

 IFNULL
 NULLIF
 IF

These are functions which don't fit into any other categories.

 ENCRYPT
 ENCODE
 DECODE
 FORMAT
 INET_NTOA
 INET_ATON
 BIT_OR
 BIT_AND
 PASSWORD
 MD5
 LOAD_FILE

These are functions related to MySQL's fulltext searching capabilities.

 MATCH
 AGAINST
 IN_BOOLEAN_MODE

NOTE: In MySQL 4.0 and greater, it is possible to say that a search is in boolean mode in order to change how MySQL handles the argument given to AGAINST. This will not work with earlier versions.

These are functions from other groups that are most commonly used.

 NOW
 COUNT
 AVG
 MIN
 MAX
 SUM
 DISTINCT

Dave Rolsky, <dave@urth.org>

2022-06-14 perl v5.34.0