db_type_map

6 database.pgsql.inc db_type_map()
6 database.mysql-common.inc db_type_map()

This maps a generic data type in combination with its data size to the engine-specific data type.

Related topics

3 calls to db_type_map()

File

includes/database.mysql-common.inc, line 205
Functions shared between mysql and mysqli database engines.

Code

function db_type_map() {
  // Put :normal last so it gets preserved by array_flip.  This makes
  // it much easier for modules (such as schema.module) to map
  // database types back into schema types.
  $map = array(
    'varchar:normal' => 'VARCHAR', 
    'char:normal' => 'CHAR', 
    'text:tiny' => 'TINYTEXT', 
    'text:small' => 'TINYTEXT', 
    'text:medium' => 'MEDIUMTEXT', 
    'text:big' => 'LONGTEXT', 
    'text:normal' => 'TEXT', 
    'serial:tiny' => 'TINYINT', 
    'serial:small' => 'SMALLINT', 
    'serial:medium' => 'MEDIUMINT', 
    'serial:big' => 'BIGINT', 
    'serial:normal' => 'INT', 
    'int:tiny' => 'TINYINT', 
    'int:small' => 'SMALLINT', 
    'int:medium' => 'MEDIUMINT', 
    'int:big' => 'BIGINT', 
    'int:normal' => 'INT', 
    'float:tiny' => 'FLOAT', 
    'float:small' => 'FLOAT', 
    'float:medium' => 'FLOAT', 
    'float:big' => 'DOUBLE', 
    'float:normal' => 'FLOAT', 
    'numeric:normal' => 'DECIMAL', 
    'blob:big' => 'LONGBLOB', 
    'blob:normal' => 'BLOB', 
    'datetime:normal' => 'DATETIME',
  );
  return $map;
}
Login or register to post comments