src/Components/Schema.php
public function extractSimpleType($type, $size = null, $scale = null)
    {
        switch (strtolower($type)) {
            case 'bit':
            case (false !== stripos($type, 'bool')):
                $value = DbSimpleTypes::TYPE_BOOLEAN;
                break;

            case 'number': // Oracle for boolean, integers and decimals
                if ($size == 1) {
                    $value = DbSimpleTypes::TYPE_BOOLEAN;
                } elseif (empty($scale)) {
                    $value = DbSimpleTypes::TYPE_INTEGER;
                } else {
                    $value = DbSimpleTypes::TYPE_DECIMAL;
                }
                break;

            case 'decimal':
            case 'numeric':
            case 'percent':
                $value = DbSimpleTypes::TYPE_DECIMAL;
                break;

            case (false !== stripos($type, 'double')):
                $value = DbSimpleTypes::TYPE_DOUBLE;
                break;

            case 'real':
            case (false !== stripos($type, 'float')):
                if ($size == 53) {
                    $value = DbSimpleTypes::TYPE_DOUBLE;
                } else {
                    $value = DbSimpleTypes::TYPE_FLOAT;
                }
                break;

            case (false !== stripos($type, 'money')):
                $value = DbSimpleTypes::TYPE_MONEY;
                break;

            case 'binary_integer': // oracle integer
            case 'tinyint':
            case 'smallint':
            case 'mediumint':
            case 'int':
            case 'integer':
            case 'serial': // Informix
                // watch out for point here!
                if ($size == 1) {
                    $value = DbSimpleTypes::TYPE_BOOLEAN;
                } else {
                    $value = DbSimpleTypes::TYPE_INTEGER;
                }
                break;

            case 'varint': // java type used in cassandra, possibly others, can be really big
            case 'bigint':
            case 'bigserial': // Informix
            case 'serial8': // Informix
                // bigint too big to represent as number in php
                $value = DbSimpleTypes::TYPE_BIG_INT;
                break;

            case (false !== stripos($type, 'timestamp')):
            case 'datetimeoffset': //  MSSQL
                $value = DbSimpleTypes::TYPE_TIMESTAMP;
                break;

            case (false !== stripos($type, 'datetime')):
                $value = DbSimpleTypes::TYPE_DATETIME;
                break;

            case 'date':
                $value = DbSimpleTypes::TYPE_DATE;
                break;

            case 'timeuuid': // type 1 time-based UUID
                $value = DbSimpleTypes::TYPE_TIME_UUID;
                break;

            case (false !== stripos($type, 'time')):
                $value = DbSimpleTypes::TYPE_TIME;
                break;

            case (false !== stripos($type, 'binary')):
            case (false !== stripos($type, 'blob')):
                $value = DbSimpleTypes::TYPE_BINARY;
                break;

            //	String types
            case (false !== stripos($type, 'clob')):
            case (false !== stripos($type, 'text')):
            case 'lvarchar': // informix
                $value = DbSimpleTypes::TYPE_TEXT;
                break;

            case 'varchar':
                if ($size == -1) {
                    $value = DbSimpleTypes::TYPE_TEXT; // varchar(max) in MSSQL
                } else {
                    $value = DbSimpleTypes::TYPE_STRING;
                }
                break;

            case 'uuid':
                $value = DbSimpleTypes::TYPE_UUID;
                break;

            // common routine return types
            case 'ref cursor':
                $value = DbSimpleTypes::TYPE_REF_CURSOR;
                break;

            case 'table':
                $value = DbSimpleTypes::TYPE_TABLE;
                break;

            case 'array':
            case 'map':
            case 'set':
            case 'list':
            case 'tuple':
                $value = DbSimpleTypes::TYPE_ARRAY;
                break;

            case 'column':
                $value = DbSimpleTypes::TYPE_COLUMN;
                break;

            case 'row':
                $value = DbSimpleTypes::TYPE_ROW;
                break;

            case 'string':
            case (false !== stripos($type, 'char')):
            default:
                $value = DbSimpleTypes::TYPE_STRING; // default to string to handle anything
                break;
        }

        return $value;
    }
public function extractSimpleType($type, $size = null, $scale = null)
    {
        switch (strtolower($type)) {
            case 'bit':
            case (false !== stripos($type, 'bool')):
                $value = DbSimpleTypes::TYPE_BOOLEAN;
                break;

            case 'number': // Oracle for boolean, integers and decimals
                if ($size == 1) {
                    $value = DbSimpleTypes::TYPE_BOOLEAN;
                } elseif (empty($scale)) {
                    $value = DbSimpleTypes::TYPE_INTEGER;
                } else {
                    $value = DbSimpleTypes::TYPE_DECIMAL;
                }
                break;

            case 'decimal':
            case 'numeric':
            case 'percent':
                $value = DbSimpleTypes::TYPE_DECIMAL;
                break;

            case (false !== stripos($type, 'double')):
                $value = DbSimpleTypes::TYPE_DOUBLE;
                break;

            case 'real':
            case (false !== stripos($type, 'float')):
                if ($size == 53) {
                    $value = DbSimpleTypes::TYPE_DOUBLE;
                } else {
                    $value = DbSimpleTypes::TYPE_FLOAT;
                }
                break;

            case (false !== stripos($type, 'money')):
                $value = DbSimpleTypes::TYPE_MONEY;
                break;

            case 'binary_integer': // oracle integer
            case 'tinyint':
            case 'smallint':
            case 'mediumint':
            case 'int':
            case 'integer':
            case 'serial': // Informix
                // watch out for point here!
                if ($size == 1) {
                    $value = DbSimpleTypes::TYPE_BOOLEAN;
                } else {
                    $value = DbSimpleTypes::TYPE_INTEGER;
                }
                break;

            case 'varint': // java type used in cassandra, possibly others, can be really big
            case 'bigint':
            case 'bigserial': // Informix
            case 'serial8': // Informix
                // bigint too big to represent as number in php
                $value = DbSimpleTypes::TYPE_BIG_INT;
                break;

            case (false !== stripos($type, 'timestamp')):
            case 'datetimeoffset': //  MSSQL
                $value = DbSimpleTypes::TYPE_TIMESTAMP;
                break;

            case (false !== stripos($type, 'datetime')):
                $value = DbSimpleTypes::TYPE_DATETIME;
                break;

            case 'date':
                $value = DbSimpleTypes::TYPE_DATE;
                break;

            case 'timeuuid': // type 1 time-based UUID
                $value = DbSimpleTypes::TYPE_TIME_UUID;
                break;

            case (false !== stripos($type, 'time')):
                $value = DbSimpleTypes::TYPE_TIME;
                break;

            case (false !== stripos($type, 'binary')):
            case (false !== stripos($type, 'blob')):
                $value = DbSimpleTypes::TYPE_BINARY;
                break;

            //	String types
            case (false !== stripos($type, 'clob')):
            case (false !== stripos($type, 'text')):
            case 'lvarchar': // informix
                $value = DbSimpleTypes::TYPE_TEXT;
                break;

            case 'varchar':
                if ($size == -1) {
                    $value = DbSimpleTypes::TYPE_TEXT; // varchar(max) in MSSQL
                } else {
                    $value = DbSimpleTypes::TYPE_STRING;
                }
                break;

            case 'uuid':
                $value = DbSimpleTypes::TYPE_UUID;
                break;

            // common routine return types
            case 'ref cursor':
                $value = DbSimpleTypes::TYPE_REF_CURSOR;
                break;

            case 'table':
                $value = DbSimpleTypes::TYPE_TABLE;
                break;

            case 'array':
            case 'map':
            case 'set':
            case 'list':
            case 'tuple':
                $value = DbSimpleTypes::TYPE_ARRAY;
                break;

            case 'column':
                $value = DbSimpleTypes::TYPE_COLUMN;
                break;

            case 'row':
                $value = DbSimpleTypes::TYPE_ROW;
                break;

            case 'string':
            case (false !== stripos($type, 'char')):
            default:
                $value = DbSimpleTypes::TYPE_STRING; // default to string to handle anything
                break;
        }

        return $value;
    }
@param      $type
@param null $size
@param null $scale

@return string