QuickBooks/Driver/Sql/Sqlite.php
protected function _generateFieldSchema($name, $def)
    {
        switch ($def[0])
        {
            case QUICKBOOKS_DRIVER_SQL_SERIAL:

                $sql = $name . ' INTEGER PRIMARY KEY  '; // AUTO_INCREMENT
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP:
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_INSERT_OR_UPDATE:

                $sql = $name . ' TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_UPDATE:

                $sql = $name . ' TIMESTAMP DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_INSERT:

                $sql = $name . ' TIMESTAMP DEFAULT CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_BOOLEAN:
                $sql = $name . ' tinyint(1) ';

                if (isset($def[2]))
                {
                    if (strtolower($def[2]) == 'null')
                    {
                        $sql .= ' DEFAULT NULL ';
                    }
                    else if ($def[2])
                    {
                        $sql .= ' DEFAULT 1 ';
                    }
                    else
                    {
                        $sql .= ' DEFAULT 0 ';
                    }
                }

                return $sql;
            case QUICKBOOKS_DRIVER_SQL_INTEGER:
                $sql = $name . ' int(10) ';

                if (isset($def[2]))
                {
                    if (strtolower($def[2]) == 'null')
                    {
                        $sql .= ' DEFAULT NULL ';
                    }
                    else
                    {
                        $sql .= ' DEFAULT ' . (int) $def[2];
                    }
                }
                else
                {
                    $sql .= ' NOT NULL ';
                }

                return $sql;
            default:

                return parent::_generateFieldSchema($name, $def);
        }
    }
protected function _generateFieldSchema($name, $def)
    {
        switch ($def[0])
        {
            case QUICKBOOKS_DRIVER_SQL_SERIAL:

                $sql = $name . ' INTEGER PRIMARY KEY  '; // AUTO_INCREMENT
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP:
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_INSERT_OR_UPDATE:

                $sql = $name . ' TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_UPDATE:

                $sql = $name . ' TIMESTAMP DEFAULT 0 ON UPDATE CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_TIMESTAMP_ON_INSERT:

                $sql = $name . ' TIMESTAMP DEFAULT CURRENT_TIMESTAMP ';
                return $sql;
            case QUICKBOOKS_DRIVER_SQL_BOOLEAN:
                $sql = $name . ' tinyint(1) ';

                if (isset($def[2]))
                {
                    if (strtolower($def[2]) == 'null')
                    {
                        $sql .= ' DEFAULT NULL ';
                    }
                    else if ($def[2])
                    {
                        $sql .= ' DEFAULT 1 ';
                    }
                    else
                    {
                        $sql .= ' DEFAULT 0 ';
                    }
                }

                return $sql;
            case QUICKBOOKS_DRIVER_SQL_INTEGER:
                $sql = $name . ' int(10) ';

                if (isset($def[2]))
                {
                    if (strtolower($def[2]) == 'null')
                    {
                        $sql .= ' DEFAULT NULL ';
                    }
                    else
                    {
                        $sql .= ' DEFAULT ' . (int) $def[2];
                    }
                }
                else
                {
                    $sql .= ' NOT NULL ';
                }

                return $sql;
            default:

                return parent::_generateFieldSchema($name, $def);
        }
    }
Override for the default SQL generation functions, MySQL-specific field generation function

@param string $name
@param array $def
@return string