_db_process_field

6 database.pgsql.inc _db_process_field($field)
6 database.mysql-common.inc _db_process_field($field)

Set database-engine specific properties for a field.

Parameters

$field: A field description array, as specified in the schema documentation.

Related topics

5 functions call _db_process_field()

File

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

Code

<?php
function _db_process_field($field) {

  if (!isset($field['size'])) {
    $field['size'] = 'normal';
  }

  // Set the correct database-engine specific datatype.
  if (!isset($field['mysql_type'])) {
    $map = db_type_map();
    $field['mysql_type'] = $map[$field['type'] . ':' . $field['size']];
  }

  if ($field['type'] == 'serial') {
    $field['auto_increment'] = TRUE;
  }

  return $field;
}
?>