Qore MysqlSqlUtil Module Reference 1.5
|
The MysqlSqlUtil module provides a high level API for working with MySQL database objects.
Usually this module is loaded on demand from the SqlUtil module, however to use this module directly, use "%requires MysqlSqlUtil"
in your code.
All the public symbols in the module are defined in the MysqlSqlUtil namespace
Column types are mapped from Qore types as follows:
MySQL Column Type Mappings
Generic Type Name | MySQL Type Used |
float | double |
number | decimal |
string | varchar |
date | datetime |
binary | varbinary |
bool | tinyint |
SqlUtil::BLOB | mediumblob |
SqlUtil::CHAR | char |
SqlUtil::CLOB | mediumtext |
SqlUtil::NUMERIC | decimal |
SqlUtil::VARCHAR | varchar |
To use other types, use the "native_type"
column description option with the native MySQL type name instead (under the "driver"
and "mysql"
keys for schemas supporting multiple databases).
MySQL currently does not support firing "before insert" or "before update" triggers before constraints are checked, so in other databases where a trigger will set a default value for a column when a NULL is inserted, MySQL will raise an error if there is a NOT NULL constraint on the column.
VARCHAR
column to be created without a size, assume a default size (issue 4399)varbinary
type (bug 403)binary
type (bug 524)schema
member incorrectly set by AbstractDatasource::getUserName() instead of AbstractDatasource::getDBName() (bug 519)binary
, char
, varbinary
, varchar
cop_cast
operator (feature 535)