You are here

function db_type_map in Drupal 6

Same name in this branch
  1. 6 includes/database.mysql-common.inc \db_type_map()
  2. 6 includes/database.pgsql.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()
db_change_field in includes/database.pgsql.inc
Change a field definition.
_db_process_field in includes/database.mysql-common.inc
Set database-engine specific properties for a field.
_db_process_field in includes/database.pgsql.inc
Set database-engine specific properties for a field.

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;
}