Commit eb65d5af authored by Guilherme Blanco's avatar Guilherme Blanco

Merge pull request #104 from kimhemsoe/drizzle_step2

Added keywards to drizzle platform.
parents e6a8c840 9d7ad1e2
...@@ -19,9 +19,14 @@ ...@@ -19,9 +19,14 @@
namespace Doctrine\DBAL\Driver\DrizzlePDOMySql; namespace Doctrine\DBAL\Driver\DrizzlePDOMySql;
/**
* @author Kim Hemsø Rasmussen <kimhemsoe@gmail.com>
*/
class Connection extends \Doctrine\DBAL\Driver\PDOConnection class Connection extends \Doctrine\DBAL\Driver\PDOConnection
{ {
/**
* {@inheritdoc}
*/
public function quote($value, $type=\PDO::PARAM_STR) public function quote($value, $type=\PDO::PARAM_STR)
{ {
if (\PDO::PARAM_BOOL === $type) { if (\PDO::PARAM_BOOL === $type) {
......
...@@ -27,13 +27,7 @@ namespace Doctrine\DBAL\Driver\DrizzlePDOMySql; ...@@ -27,13 +27,7 @@ namespace Doctrine\DBAL\Driver\DrizzlePDOMySql;
class Driver implements \Doctrine\DBAL\Driver class Driver implements \Doctrine\DBAL\Driver
{ {
/** /**
* Attempts to establish a connection with the underlying driver. * {@inheritdoc}
*
* @param array $params
* @param string $username
* @param string $password
* @param array $driverOptions
* @return Doctrine\DBAL\Driver\Connection
*/ */
public function connect(array $params, $username = null, $password = null, array $driverOptions = array()) public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
{ {
...@@ -70,21 +64,33 @@ class Driver implements \Doctrine\DBAL\Driver ...@@ -70,21 +64,33 @@ class Driver implements \Doctrine\DBAL\Driver
return $dsn; return $dsn;
} }
/**
* {@inheritdoc}
*/
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
return new \Doctrine\DBAL\Platforms\DrizzlePlatform(); return new \Doctrine\DBAL\Platforms\DrizzlePlatform();
} }
/**
* {@inheritdoc}
*/
public function getSchemaManager(\Doctrine\DBAL\Connection $conn) public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{ {
return new \Doctrine\DBAL\Schema\DrizzleSchemaManager($conn); return new \Doctrine\DBAL\Schema\DrizzleSchemaManager($conn);
} }
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'drizzle_pdo_mysql'; return 'drizzle_pdo_mysql';
} }
/**
* {@inheritdoc}
*/
public function getDatabase(\Doctrine\DBAL\Connection $conn) public function getDatabase(\Doctrine\DBAL\Connection $conn)
{ {
$params = $conn->getParams(); $params = $conn->getParams();
......
...@@ -32,9 +32,7 @@ use Doctrine\DBAL\DBALException, ...@@ -32,9 +32,7 @@ use Doctrine\DBAL\DBALException,
class DrizzlePlatform extends AbstractPlatform class DrizzlePlatform extends AbstractPlatform
{ {
/** /**
* Get the platform name for this instance. * {@inheritdoc}
*
* @return string
*/ */
public function getName() public function getName()
{ {
...@@ -42,10 +40,7 @@ class DrizzlePlatform extends AbstractPlatform ...@@ -42,10 +40,7 @@ class DrizzlePlatform extends AbstractPlatform
} }
/** /**
* Gets the character used for identifier quoting. * {@inheritdoc}
*
* @return string
* @override
*/ */
public function getIdentifierQuoteCharacter() public function getIdentifierQuoteCharacter()
{ {
...@@ -292,6 +287,12 @@ class DrizzlePlatform extends AbstractPlatform ...@@ -292,6 +287,12 @@ class DrizzlePlatform extends AbstractPlatform
return 'DATE'; return 'DATE';
} }
/**
* C/P from mysql platform
*
* @param TableDiff $diff
* @return type
*/
public function getAlterTableSQL(TableDiff $diff) public function getAlterTableSQL(TableDiff $diff)
{ {
$columnSql = array(); $columnSql = array();
......
...@@ -21,13 +21,9 @@ ...@@ -21,13 +21,9 @@
namespace Doctrine\DBAL\Platforms\Keywords; namespace Doctrine\DBAL\Platforms\Keywords;
/** /**
* MySQL Keywordlist * Drizzle Keywordlist
* *
* @license BSD http://www.opensource.org/licenses/bsd-license.php * @author Kim Hemsø Rasmussen <kimhemsoe@gmail.com>
* @link www.doctrine-project.com
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author David Coallier <davidc@php.net>
*/ */
class DrizzleKeywords extends KeywordList class DrizzleKeywords extends KeywordList
{ {
...@@ -39,6 +35,306 @@ class DrizzleKeywords extends KeywordList ...@@ -39,6 +35,306 @@ class DrizzleKeywords extends KeywordList
protected function getKeywords() protected function getKeywords()
{ {
return array( return array(
'ABS',
'ALL',
'ALLOCATE',
'ALTER',
'AND',
'ANY',
'ARE',
'ARRAY',
'AS',
'ASENSITIVE',
'ASYMMETRIC',
'AT',
'ATOMIC',
'AUTHORIZATION',
'AVG',
'BEGIN',
'BETWEEN',
'BIGINT',
'BINARY',
'BLOB',
'BOOLEAN',
'BOTH',
'BY',
'CALL',
'CALLED',
'CARDINALITY',
'CASCADED',
'CASE',
'CAST',
'CEIL',
'CEILING',
'CHAR',
'CHARACTER',
'CHARACTER_LENGTH',
'CHAR_LENGTH',
'CHECK',
'CLOB',
'CLOSE',
'COALESCE',
'COLLATE',
'COLLECT',
'COLUMN',
'COMMIT',
'CONDITION',
'CONNECT',
'CONSTRAINT',
'CONVERT',
'CORR',
'CORRESPONDING',
'COUNT',
'COVAR_POP',
'COVAR_SAMP',
'CREATE',
'CROSS',
'CUBE',
'CUME_DIST',
'CURRENT',
'CURRENT_DATE',
'CURRENT_DEFAULT_TRANSFORM_GROUP',
'CURRENT_PATH',
'CURRENT_ROLE',
'CURRENT_TIME',
'CURRENT_TIMESTAMP',
'CURRENT_TRANSFORM_GROUP_FOR_TYPE',
'CURRENT_USER',
'CURSOR',
'CYCLE',
'DATE',
'DAY',
'DEALLOCATE',
'DEC',
'DECIMAL',
'DECLARE',
'DEFAULT',
'DELETE',
'DENSE_RANK',
'DEREF',
'DESCRIBE',
'DETERMINISTIC',
'DISCONNECT',
'DISTINCT',
'DOUBLE',
'DROP',
'DYNAMIC',
'EACH',
'ELEMENT',
'ELSE',
'END',
'ESCAPE',
'EVERY',
'EXCEPT',
'EXEC',
'EXECUTE',
'EXISTS',
'EXP',
'EXTERNAL',
'EXTRACT',
'FALSE',
'FETCH',
'FILTER',
'FLOAT',
'FLOOR',
'FOR',
'FOREIGN',
'FREE',
'FROM',
'FULL',
'FUNCTION',
'FUSION',
'GET',
'GLOBAL',
'GRANT',
'GROUP',
'GROUPING',
'HAVING',
'HOLD',
'HOUR',
'IDENTITY',
'IN',
'INDICATOR',
'INNER',
'INOUT',
'INSENSITIVE',
'INSERT',
'INT',
'INTEGER',
'INTERSECT',
'INTERSECTION',
'INTERVAL',
'INTO',
'IS',
'JOIN',
'LANGUAGE',
'LARGE',
'LATERAL',
'LEADING',
'LEFT',
'LIKE',
'LN',
'LOCAL',
'LOCALTIME',
'LOCALTIMESTAMP',
'LOWER',
'MATCH',
'MAX',
'MEMBER',
'MERGE',
'METHOD',
'MIN',
'MINUTE',
'MOD',
'MODIFIES',
'MODULE',
'MONTH',
'MULTISET',
'NATIONAL',
'NATURAL',
'NCHAR',
'NCLOB',
'NEW',
'NO',
'NONE',
'NORMALIZE',
'NOT',
'NULL_SYM',
'NULLIF',
'NUMERIC',
'OCTET_LENGTH',
'OF',
'OLD',
'ON',
'ONLY',
'OPEN',
'OR',
'ORDER',
'OUT',
'OUTER',
'OVER',
'OVERLAPS',
'OVERLAY',
'PARAMETER',
'PARTITION',
'PERCENTILE_CONT',
'PERCENTILE_DISC',
'PERCENT_RANK',
'POSITION',
'POWER',
'PRECISION',
'PREPARE',
'PRIMARY',
'PROCEDURE',
'RANGE',
'RANK',
'READS',
'REAL',
'RECURSIVE',
'REF',
'REFERENCES',
'REFERENCING',
'REGR_AVGX',
'REGR_AVGY',
'REGR_COUNT',
'REGR_INTERCEPT',
'REGR_R2',
'REGR_SLOPE',
'REGR_SXX',
'REGR_SXY',
'REGR_SYY',
'RELEASE',
'RESULT',
'RETURN',
'RETURNS',
'REVOKE',
'RIGHT',
'ROLLBACK',
'ROLLUP',
'ROW',
'ROWS',
'ROW_NUMBER',
'SAVEPOINT',
'SCOPE',
'SCROLL',
'SEARCH',
'SECOND',
'SELECT',
'SENSITIVE',
'SESSION_USER',
'SET',
'SIMILAR',
'SMALLINT',
'SOME',
'SPECIFIC',
'SPECIFICTYPE',
'SQL',
'SQLEXCEPTION',
'SQLSTATE',
'SQLWARNING',
'SQRT',
'START',
'STATIC',
'STDDEV_POP',
'STDDEV_SAMP',
'SUBMULTISET',
'SUBSTRING',
'SUM',
'SYMMETRIC',
'SYSTEM',
'SYSTEM_USER',
'TABLE',
'TABLESAMPLE',
'THEN',
'TIME',
'TIMESTAMP',
'TIMEZONE_HOUR',
'TIMEZONE_MINUTE',
'TO',
'TRAILING',
'TRANSLATE',
'TRANSLATION',
'TREAT',
'TRIGGER',
'TRIM',
'TRUE',
'UESCAPE',
'UNION',
'UNIQUE',
'UNKNOWN',
'UNNEST',
'UPDATE',
'UPPER',
'USER',
'USING',
'VALUE',
'VALUES',
'VARCHAR',
'VARYING',
'VAR_POP',
'VAR_SAMP',
'WHEN',
'WHENEVER',
'WHERE',
'WIDTH_BUCKET',
'WINDOW',
'WITH',
'WITHIN',
'WITHOUT',
'XML',
'XMLAGG',
'XMLATTRIBUTES',
'XMLBINARY',
'XMLCOMMENT',
'XMLCONCAT',
'XMLELEMENT',
'XMLFOREST',
'XMLNAMESPACES',
'XMLPARSE',
'XMLPI',
'XMLROOT',
'XMLSERIALIZE',
'YEAR',
); );
} }
} }
\ No newline at end of file
...@@ -82,7 +82,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager ...@@ -82,7 +82,7 @@ class DrizzleSchemaManager extends AbstractSchemaManager
); );
} }
protected function _getPortableTableIndexesList($tableIndexes, $tableName=null) protected function _getPortableTableIndexesList($tableIndexes, $tableName = null)
{ {
$indexes = array(); $indexes = array();
foreach ($tableIndexes as $k) { foreach ($tableIndexes as $k) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment