Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
143c2510
Commit
143c2510
authored
Mar 12, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #272 from deeky666/refactor-mssql-keywords
Refactor SQL Server keyword dictionaries and MsSQL leftovers
parents
f69a44e6
7c1893cf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
401 additions
and
232 deletions
+401
-232
configuration.rst
docs/en/reference/configuration.rst
+2
-2
portability.rst
docs/en/reference/portability.rst
+1
-1
MsSQLKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
+2
-209
SQLServer2005Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2005Keywords.php
+56
-0
SQLServer2008Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2008Keywords.php
+51
-0
SQLServer2012Keywords.php
...octrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
+5
-4
SQLServerKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
+231
-0
SQLServer2005Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php
+11
-1
SQLServer2008Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php
+11
-1
SQLServer2012Platform.php
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
+3
-1
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+4
-4
ReservedWordsCommand.php
...trine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
+24
-9
No files found.
docs/en/reference/configuration.rst
View file @
143c2510
...
...
@@ -37,7 +37,7 @@ interfaces to use. It can be configured in one of three ways:
- ``driver``: The built-in driver implementation to use. The
following drivers are currently available:
- ``pdo_mysql``: A MySQL driver that uses the pdo\_mysql PDO
extension.
- ``pdo_sqlite``: An SQLite driver that uses the pdo\_sqlite PDO
...
...
@@ -47,7 +47,7 @@ interfaces to use. It can be configured in one of three ways:
- ``pdo_oci``: An Oracle driver that uses the pdo\_oci PDO
extension.
**Note that this driver caused problems in our tests. Prefer the oci8 driver if possible.**
- ``pdo_sqlsrv``: A
n MSSQL
driver that uses pdo\_sqlsrv PDO
- ``pdo_sqlsrv``: A
Microsoft SQL Server
driver that uses pdo\_sqlsrv PDO
- ``oci8``: An Oracle driver that uses the oci8 PHP extension.
- ``driverClass``: Specifies a custom driver implementation if no
...
...
docs/en/reference/portability.rst
View file @
143c2510
...
...
@@ -4,7 +4,7 @@ Portability
There are often cases when you need to write an application or library that is portable
across multiple different database vendors. The Doctrine ORM is one example of such
a library. It is an abstraction layer over all the currently supported vendors (MySQL, Oracle,
PostgreSQL, SQLite and M
SSQL
). If you want to use the DBAL to write a portable application
PostgreSQL, SQLite and M
icrosoft SQL Server
). If you want to use the DBAL to write a portable application
or library you have to follow lots of rules to make all the different vendors work the
same.
...
...
lib/Doctrine/DBAL/Platforms/Keywords/MsSQLKeywords.php
View file @
143c2510
...
...
@@ -29,8 +29,9 @@ namespace Doctrine\DBAL\Platforms\Keywords;
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author David Coallier <davidc@php.net>
* @author Steve Müller <st.mueller@dzh-online.de>
* @deprecated Use SQLServerKeywords class instead.
*/
class
MsSQLKeywords
extends
KeywordList
class
MsSQLKeywords
extends
SQLServerKeywords
{
/**
* {@inheritdoc}
...
...
@@ -39,212 +40,4 @@ class MsSQLKeywords extends KeywordList
{
return
'MsSQL'
;
}
/**
* {@inheritdoc}
*/
protected
function
getKeywords
()
{
return
array
(
'ADD'
,
'CURRENT_TIMESTAMP'
,
'GROUP'
,
'OPENQUERY'
,
'SERIALIZABLE'
,
'ALL'
,
'CURRENT_USER'
,
'HAVING'
,
'OPENROWSET'
,
'SESSION_USER'
,
'ALTER'
,
'CURSOR'
,
'HOLDLOCK'
,
'OPTION'
,
'SET'
,
'AND'
,
'DATABASE'
,
'IDENTITY'
,
'OR'
,
'SETUSER'
,
'ANY'
,
'DBCC'
,
'IDENTITYCOL'
,
'ORDER'
,
'SHUTDOWN'
,
'AS'
,
'DEALLOCATE'
,
'IDENTITY_INSERT'
,
'OUTER'
,
'SOME'
,
'ASC'
,
'DECLARE'
,
'IF'
,
'OVER'
,
'STATISTICS'
,
'AUTHORIZATION'
,
'DEFAULT'
,
'IN'
,
'PERCENT'
,
'SUM'
,
'AVG'
,
'DELETE'
,
'INDEX'
,
'PERM'
,
'SYSTEM_USER'
,
'BACKUP'
,
'DENY'
,
'INNER'
,
'PERMANENT'
,
'TABLE'
,
'BEGIN'
,
'DESC'
,
'INSERT'
,
'PIPE'
,
'TAPE'
,
'BETWEEN'
,
'DISK'
,
'INTERSECT'
,
'PLAN'
,
'TEMP'
,
'BREAK'
,
'DISTINCT'
,
'INTO'
,
'PRECISION'
,
'TEMPORARY'
,
'BROWSE'
,
'DISTRIBUTED'
,
'IS'
,
'PREPARE'
,
'TEXTSIZE'
,
'BULK'
,
'DOUBLE'
,
'ISOLATION'
,
'PRIMARY'
,
'THEN'
,
'BY'
,
'DROP'
,
'JOIN'
,
'PRINT'
,
'TO'
,
'CASCADE'
,
'DUMMY'
,
'KEY'
,
'PRIVILEGES'
,
'TOP'
,
'CASE'
,
'DUMP'
,
'KILL'
,
'PROC'
,
'TRAN'
,
'CHECK'
,
'ELSE'
,
'LEFT'
,
'PROCEDURE'
,
'TRANSACTION'
,
'CHECKPOINT'
,
'END'
,
'LEVEL'
,
'PROCESSEXIT'
,
'TRIGGER'
,
'CLOSE'
,
'ERRLVL'
,
'LIKE'
,
'PUBLIC'
,
'TRUNCATE'
,
'CLUSTERED'
,
'ERROREXIT'
,
'LINENO'
,
'RAISERROR'
,
'TSEQUAL'
,
'COALESCE'
,
'ESCAPE'
,
'LOAD'
,
'READ'
,
'UNCOMMITTED'
,
'COLUMN'
,
'EXCEPT'
,
'MAX'
,
'READTEXT'
,
'UNION'
,
'COMMIT'
,
'EXEC'
,
'MIN'
,
'RECONFIGURE'
,
'UNIQUE'
,
'COMMITTED'
,
'EXECUTE'
,
'MIRROREXIT'
,
'REFERENCES'
,
'UPDATE'
,
'COMPUTE'
,
'EXISTS'
,
'NATIONAL'
,
'REPEATABLE'
,
'UPDATETEXT'
,
'CONFIRM'
,
'EXIT'
,
'NOCHECK'
,
'REPLICATION'
,
'USE'
,
'CONSTRAINT'
,
'FETCH'
,
'NONCLUSTERED'
,
'RESTORE'
,
'USER'
,
'CONTAINS'
,
'FILE'
,
'NOT'
,
'RESTRICT'
,
'VALUES'
,
'CONTAINSTABLE'
,
'FILLFACTOR'
,
'NULL'
,
'RETURN'
,
'VARYING'
,
'CONTINUE'
,
'FLOPPY'
,
'NULLIF'
,
'REVOKE'
,
'VIEW'
,
'CONTROLROW'
,
'FOR'
,
'OF'
,
'RIGHT'
,
'WAITFOR'
,
'CONVERT'
,
'FOREIGN'
,
'OFF'
,
'ROLLBACK'
,
'WHEN'
,
'COUNT'
,
'FREETEXT'
,
'OFFSETS'
,
'ROWCOUNT'
,
'WHERE'
,
'CREATE'
,
'FREETEXTTABLE'
,
'ON'
,
'ROWGUIDCOL'
,
'WHILE'
,
'CROSS'
,
'FROM'
,
'ONCE'
,
'RULE'
,
'WITH'
,
'CURRENT'
,
'FULL'
,
'ONLY'
,
'SAVE'
,
'WORK'
,
'CURRENT_DATE'
,
'GOTO'
,
'OPEN'
,
'SCHEMA'
,
'WRITETEXT'
,
'CURRENT_TIME'
,
'GRANT'
,
'OPENDATASOURCE'
,
'SELECT'
);
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2005Keywords.php
0 → 100644
View file @
143c2510
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Platforms\Keywords
;
/**
* Microsoft SQL Server 2005 reserved keyword dictionary.
*
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link www.doctrine-project.com
* @since 2.3
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class
SQLServer2005Keywords
extends
SQLServerKeywords
{
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'SQLServer2005'
;
}
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-US/library/ms189822%28v=sql.90%29.aspx
*/
protected
function
getKeywords
()
{
return
array_merge
(
array_diff
(
parent
::
getKeywords
(),
array
(
'DUMMY'
)),
array
(
'EXTERNAL'
,
'PIVOT'
,
'REVERT'
,
'SECURITYAUDIT'
,
'TABLESAMPLE'
,
'UNPIVOT'
));
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2008Keywords.php
0 → 100644
View file @
143c2510
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Platforms\Keywords
;
/**
* Microsoft SQL Server 2008 reserved keyword dictionary.
*
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link www.doctrine-project.com
* @since 2.3
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class
SQLServer2008Keywords
extends
SQLServer2005Keywords
{
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'SQLServer2008'
;
}
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-us/library/ms189822%28v=sql.100%29.aspx
*/
protected
function
getKeywords
()
{
return
array_merge
(
parent
::
getKeywords
(),
array
(
'MERGE'
));
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServer2012Keywords.php
View file @
143c2510
...
...
@@ -20,14 +20,14 @@
namespace
Doctrine\DBAL\Platforms\Keywords
;
/**
*
SQL Server 2012 reserved keywords list
.
*
Microsoft SQL Server 2012 reserved keyword dictionary
.
*
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link www.doctrine-project.com
* @since 2.3
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class
SQLServer2012Keywords
extends
MsSQL
Keywords
class
SQLServer2012Keywords
extends
SQLServer2008
Keywords
{
/**
* {@inheritdoc}
...
...
@@ -39,6 +39,8 @@ class SQLServer2012Keywords extends MsSQLKeywords
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-us/library/ms189822.aspx
*/
protected
function
getKeywords
()
{
...
...
@@ -47,8 +49,7 @@ class SQLServer2012Keywords extends MsSQLKeywords
'SEMANTICSIMILARITYDETAILSTABLE'
,
'SEMANTICSIMILARITYTABLE'
,
'TRY_CONVERT'
,
'WITHIN'
,
'SEQUENCE'
'WITHIN GROUP'
));
}
}
lib/Doctrine/DBAL/Platforms/Keywords/SQLServerKeywords.php
0 → 100644
View file @
143c2510
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Platforms\Keywords
;
/**
* Microsoft SQL Server 2000 reserved keyword dictionary.
*
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link www.doctrine-project.com
* @since 2.0
* @author Benjamin Eberlei <kontakt@beberlei.de>
* @author David Coallier <davidc@php.net>
* @author Steve Müller <st.mueller@dzh-online.de>
*/
class
SQLServerKeywords
extends
KeywordList
{
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'SQLServer'
;
}
/**
* {@inheritdoc}
*
* @link http://msdn.microsoft.com/en-us/library/aa238507%28v=sql.80%29.aspx
*/
protected
function
getKeywords
()
{
return
array
(
'ADD'
,
'ALL'
,
'ALTER'
,
'AND'
,
'ANY'
,
'AS'
,
'ASC'
,
'AUTHORIZATION'
,
'BACKUP'
,
'BEGIN'
,
'BETWEEN'
,
'BREAK'
,
'BROWSE'
,
'BULK'
,
'BY'
,
'CASCADE'
,
'CASE'
,
'CHECK'
,
'CHECKPOINT'
,
'CLOSE'
,
'CLUSTERED'
,
'COALESCE'
,
'COLLATE'
,
'COLUMN'
,
'COMMIT'
,
'COMPUTE'
,
'CONSTRAINT'
,
'CONTAINS'
,
'CONTAINSTABLE'
,
'CONTINUE'
,
'CONVERT'
,
'CREATE'
,
'CROSS'
,
'CURRENT'
,
'CURRENT_DATE'
,
'CURRENT_TIME'
,
'CURRENT_TIMESTAMP'
,
'CURRENT_USER'
,
'CURSOR'
,
'DATABASE'
,
'DBCC'
,
'DEALLOCATE'
,
'DECLARE'
,
'DEFAULT'
,
'DELETE'
,
'DENY'
,
'DESC'
,
'DISK'
,
'DISTINCT'
,
'DISTRIBUTED'
,
'DOUBLE'
,
'DROP'
,
'DUMP'
,
'ELSE'
,
'END'
,
'ERRLVL'
,
'ESCAPE'
,
'EXCEPT'
,
'EXEC'
,
'EXECUTE'
,
'EXISTS'
,
'EXIT'
,
'EXTERNAL'
,
'FETCH'
,
'FILE'
,
'FILLFACTOR'
,
'FOR'
,
'FOREIGN'
,
'FREETEXT'
,
'FREETEXTTABLE'
,
'FROM'
,
'FULL'
,
'FUNCTION'
,
'GOTO'
,
'GRANT'
,
'GROUP'
,
'HAVING'
,
'HOLDLOCK'
,
'IDENTITY'
,
'IDENTITY_INSERT'
,
'IDENTITYCOL'
,
'IF'
,
'IN'
,
'INDEX'
,
'INNER'
,
'INSERT'
,
'INTERSECT'
,
'INTO'
,
'IS'
,
'JOIN'
,
'KEY'
,
'KILL'
,
'LEFT'
,
'LIKE'
,
'LINENO'
,
'LOAD'
,
'NATIONAL'
,
'NOCHECK '
,
'NONCLUSTERED'
,
'NOT'
,
'NULL'
,
'NULLIF'
,
'OF'
,
'OFF'
,
'OFFSETS'
,
'ON'
,
'OPEN'
,
'OPENDATASOURCE'
,
'OPENQUERY'
,
'OPENROWSET'
,
'OPENXML'
,
'OPTION'
,
'OR'
,
'ORDER'
,
'OUTER'
,
'OVER'
,
'PERCENT'
,
'PIVOT'
,
'PLAN'
,
'PRECISION'
,
'PRIMARY'
,
'PRINT'
,
'PROC'
,
'PROCEDURE'
,
'PUBLIC'
,
'RAISERROR'
,
'READ'
,
'READTEXT'
,
'RECONFIGURE'
,
'REFERENCES'
,
'REPLICATION'
,
'RESTORE'
,
'RESTRICT'
,
'RETURN'
,
'REVERT'
,
'REVOKE'
,
'RIGHT'
,
'ROLLBACK'
,
'ROWCOUNT'
,
'ROWGUIDCOL'
,
'RULE'
,
'SAVE'
,
'SCHEMA'
,
'SECURITYAUDIT'
,
'SELECT'
,
'SESSION_USER'
,
'SET'
,
'SETUSER'
,
'SHUTDOWN'
,
'SOME'
,
'STATISTICS'
,
'SYSTEM_USER'
,
'TABLE'
,
'TABLESAMPLE'
,
'TEXTSIZE'
,
'THEN'
,
'TO'
,
'TOP'
,
'TRAN'
,
'TRANSACTION'
,
'TRIGGER'
,
'TRUNCATE'
,
'TSEQUAL'
,
'UNION'
,
'UNIQUE'
,
'UNPIVOT'
,
'UPDATE'
,
'UPDATETEXT'
,
'USE'
,
'USER'
,
'VALUES'
,
'VARYING'
,
'VIEW'
,
'WAITFOR'
,
'WHEN'
,
'WHERE'
,
'WHILE'
,
'WITH'
,
'WRITETEXT'
);
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2005Platform.php
View file @
143c2510
...
...
@@ -20,7 +20,7 @@
namespace
Doctrine\DBAL\Platforms
;
/**
* Platform to ensure compatibility of Doctrine with
SQLServer
2005 version and
* Platform to ensure compatibility of Doctrine with
Microsoft SQL Server
2005 version and
* higher.
*
* Differences to SQL Server 2008 are:
...
...
@@ -50,5 +50,15 @@ class SQLServer2005Platform extends SQLServerPlatform
{
return
'VARCHAR(MAX)'
;
}
/**
* {@inheritdoc}
*
* Returns Microsoft SQL Server 2005 specific keywords class
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords'
;
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2008Platform.php
View file @
143c2510
...
...
@@ -20,7 +20,7 @@
namespace
Doctrine\DBAL\Platforms
;
/**
* Platform to ensure compatibility of Doctrine with
SQLServer
2008 version.
* Platform to ensure compatibility of Doctrine with
Microsoft SQL Server
2008 version.
*
* Differences to SQL Server 2005 and before are that a new DATETIME2 type was
* introduced that has a higher precision.
...
...
@@ -97,4 +97,14 @@ class SQLServer2008Platform extends SQLServer2005Platform
$this
->
doctrineTypeMapping
[
'date'
]
=
'date'
;
$this
->
doctrineTypeMapping
[
'time'
]
=
'time'
;
}
/**
* {@inheritdoc}
*
* Returns Microsoft SQL Server 2008 specific keywords class
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords'
;
}
}
lib/Doctrine/DBAL/Platforms/SQLServer2012Platform.php
View file @
143c2510
...
...
@@ -22,7 +22,7 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\Schema\Sequence
;
/**
* Platform to ensure compatibility of Doctrine with
SQLServer
2012 version.
* Platform to ensure compatibility of Doctrine with
Microsoft SQL Server
2012 version.
*
* Differences to SQL Server 2008 and before are that sequences are introduced.
*
...
...
@@ -88,6 +88,8 @@ class SQLServer2012Platform extends SQLServer2008Platform
/**
* {@inheritdoc}
*
* Returns Microsoft SQL Server 2012 specific keywords class
*/
protected
function
getReservedKeywordsClass
()
{
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
143c2510
...
...
@@ -82,8 +82,8 @@ class SQLServerPlatform extends AbstractPlatform
/**
* {@inheritDoc}
*
* M
sSql prefers "autoincrement" identity columns since sequences can only
* be emulated with a table.
* M
icrosoft SQL Server prefers "autoincrement" identity columns
*
since sequences can only
be emulated with a table.
*/
public
function
prefersIdentityColumns
()
{
...
...
@@ -93,7 +93,7 @@ class SQLServerPlatform extends AbstractPlatform
/**
* {@inheritDoc}
*
* M
sSql
supports this through AUTO_INCREMENT columns.
* M
icrosoft SQL Server
supports this through AUTO_INCREMENT columns.
*/
public
function
supportsIdentityColumns
()
{
...
...
@@ -921,7 +921,7 @@ class SQLServerPlatform extends AbstractPlatform
*/
protected
function
getReservedKeywordsClass
()
{
return
'Doctrine\DBAL\Platforms\Keywords\
MsSQL
Keywords'
;
return
'Doctrine\DBAL\Platforms\Keywords\
SQLServer
Keywords'
;
}
/**
...
...
lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
View file @
143c2510
...
...
@@ -30,12 +30,15 @@ use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator;
class
ReservedWordsCommand
extends
Command
{
private
$keywordListClasses
=
array
(
'mysql'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'
,
'mssql'
=>
'Doctrine\DBAL\Platforms\Keywords\MsSQLKeywords'
,
'sqlite'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords'
,
'pgsql'
=>
'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords'
,
'oracle'
=>
'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'
,
'db2'
=>
'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'
,
'mysql'
=>
'Doctrine\DBAL\Platforms\Keywords\MySQLKeywords'
,
'sqlserver'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServerKeywords'
,
'sqlserver2005'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServer2005Keywords'
,
'sqlserver2008'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServer2008Keywords'
,
'sqlserver2012'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords'
,
'sqlite'
=>
'Doctrine\DBAL\Platforms\Keywords\SQLiteKeywords'
,
'pgsql'
=>
'Doctrine\DBAL\Platforms\Keywords\PostgreSQLKeywords'
,
'oracle'
=>
'Doctrine\DBAL\Platforms\Keywords\OracleKeywords'
,
'db2'
=>
'Doctrine\DBAL\Platforms\Keywords\DB2Keywords'
,
);
/**
...
...
@@ -66,7 +69,7 @@ class ReservedWordsCommand extends Command
Checks if the current database contains tables and columns
with names that are identifiers in this dialect or in other SQL dialects.
By default SQLite, MySQL, PostgreSQL, M
sSQL
and Oracle
By default SQLite, MySQL, PostgreSQL, M
icrosoft SQL Server
and Oracle
keywords are checked:
<info>%command.full_name%</info>
...
...
@@ -82,7 +85,10 @@ The following keyword lists are currently shipped with Doctrine:
* pgsql
* sqlite
* oracle
* mssql
* sqlserver
* sqlserver2005
* sqlserver2008
* sqlserver2012
* db2 (Not checked by default)
EOT
);
...
...
@@ -98,7 +104,16 @@ EOT
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
if
(
!
$keywordLists
)
{
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'mssql'
);
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'sqlserver'
,
'sqlserver2005'
,
'sqlserver2008'
,
'sqlserver2012'
);
}
$keywords
=
array
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment