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
857631f6
Unverified
Commit
857631f6
authored
Mar 07, 2018
by
Benjamin Morel
Committed by
Sergei Morozov
Nov 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop Drizzle support
parent
cb6710c9
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
63 additions
and
1372 deletions
+63
-1372
configuration.rst
docs/en/reference/configuration.rst
+2
-25
introduction.rst
docs/en/reference/introduction.rst
+0
-1
platforms.rst
docs/en/reference/platforms.rst
+0
-5
schema-representation.rst
docs/en/reference/schema-representation.rst
+5
-5
types.rst
docs/en/reference/types.rst
+43
-81
Connection.php
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php
+0
-21
Driver.php
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
+0
-59
DriverManager.php
lib/Doctrine/DBAL/DriverManager.php
+10
-13
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+0
-621
DrizzleKeywords.php
lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
+0
-326
Connection.php
lib/Doctrine/DBAL/Portability/Connection.php
+0
-3
DrizzleSchemaManager.php
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
+0
-103
DriverTest.php
...Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php
+0
-52
DriverManagerTest.php
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
+3
-4
ExceptionTest.php
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
+0
-5
DrizzleSchemaManagerTest.php
...Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php
+0
-48
No files found.
docs/en/reference/configuration.rst
View file @
857631f6
...
@@ -73,12 +73,8 @@ full driver name::
...
@@ -73,12 +73,8 @@ full driver name::
pdo-mysql://localhost:4486/foo?charset=UTF-8
pdo-mysql://localhost:4486/foo?charset=UTF-8
If you wanted to use the ``drizzle_pdo__mysql`` driver instead::
In the example above, mind the dashes instead of the
underscores in the URL scheme.
drizzle-pdo-mysql://localhost:4486/foo?charset=UTF-8
In the last two examples above, mind the dashes instead of the
underscores in the URL schemes.
For connecting to an SQLite database, the authority portion of the
For connecting to an SQLite database, the authority portion of the
URL is obviously irrelevant and thus can be omitted. The path part
URL is obviously irrelevant and thus can be omitted. The path part
...
@@ -128,8 +124,6 @@ interfaces to use. It can be configured in one of three ways:
...
@@ -128,8 +124,6 @@ interfaces to use. It can be configured in one of three ways:
- ``pdo_mysql``: A MySQL driver that uses the pdo_mysql PDO
- ``pdo_mysql``: A MySQL driver that uses the pdo_mysql PDO
extension.
extension.
- ``drizzle_pdo_mysql``: A Drizzle driver that uses pdo_mysql PDO
extension.
- ``mysqli``: A MySQL driver that uses the mysqli extension.
- ``mysqli``: A MySQL driver that uses the mysqli extension.
- ``pdo_sqlite``: An SQLite driver that uses the pdo_sqlite PDO
- ``pdo_sqlite``: An SQLite driver that uses the pdo_sqlite PDO
extension.
extension.
...
@@ -197,23 +191,6 @@ pdo_mysql
...
@@ -197,23 +191,6 @@ pdo_mysql
- ``charset`` (string): The charset used when connecting to the
- ``charset`` (string): The charset used when connecting to the
database.
database.
drizzle_pdo_mysql
^^^^^^^^^^^^^^^^^
**Requires** drizzle plugin ``mysql_protocol`` or ``mysql_unix_socket_protocol`` to be enabled.
On Ubuntu this can be done by editing ``/etc/drizzle/conf.d/mysql-protocol.cnf``
or ``/etc/drizzle/conf.d/mysql-unix-socket-protocol.cnf`` and restarting the drizzled daemon.
- ``user`` (string): Username to use when connecting to the
database. Only needed if authentication is configured for drizzled.
- ``password`` (string): Password to use when connecting to the
database. Only needed if authentication is configured for drizzled.
- ``host`` (string): Hostname of the database to connect to.
- ``port`` (integer): Port of the database to connect to.
- ``dbname`` (string): Name of the database/schema to connect to.
- ``unix_socket`` (string): Name of the socket used to connect to
the database.
mysqli
mysqli
^^^^^^
^^^^^^
...
...
docs/en/reference/introduction.rst
View file @
857631f6
...
@@ -21,7 +21,6 @@ The following database vendors are currently supported:
...
@@ -21,7 +21,6 @@ The following database vendors are currently supported:
- PostgreSQL
- PostgreSQL
- SAP Sybase SQL Anywhere
- SAP Sybase SQL Anywhere
- SQLite
- SQLite
- Drizzle
The Doctrine 2 database layer can be used independently of the
The Doctrine 2 database layer can be used independently of the
object-relational mapper. In order to use the DBAL all you need is
object-relational mapper. In order to use the DBAL all you need is
...
...
docs/en/reference/platforms.rst
View file @
857631f6
...
@@ -76,11 +76,6 @@ SQLite
...
@@ -76,11 +76,6 @@ SQLite
- ``SqlitePlatform`` for all versions.
- ``SqlitePlatform`` for all versions.
Drizzle
^^^^^^
- ``DrizzlePlatform`` for all versions.
It is highly encouraged to use the platform class that matches your
It is highly encouraged to use the platform class that matches your
database vendor and version best. Otherwise it is not guaranteed
database vendor and version best. Otherwise it is not guaranteed
that the compatibility in terms of SQL dialect and feature support
that the compatibility in terms of SQL dialect and feature support
...
...
docs/en/reference/schema-representation.rst
View file @
857631f6
...
@@ -116,10 +116,10 @@ The following options are not completely portable but are supported by most of t
...
@@ -116,10 +116,10 @@ The following options are not completely portable but are supported by most of t
vendors
:
vendors
:
-
**
unsigned
**
(
boolean
):
Whether
a
``
smallint
``,
``
integer
``
or
``
bigint
``
Doctrine
-
**
unsigned
**
(
boolean
):
Whether
a
``
smallint
``,
``
integer
``
or
``
bigint
``
Doctrine
type
column
should
allow
unsigned
values
only
.
Supported
by
MySQL
,
SQL
Anywhere
type
column
should
allow
unsigned
values
only
.
Supported
by
MySQL
and
SQL
Anywhere
.
and
Drizzle
.
Defaults
to
``
false
``.
Defaults
to
``
false
``.
-
**
comment
**
(
integer
|
string
):
The
column
comment
.
Supported
by
MySQL
,
PostgreSQL
,
-
**
comment
**
(
integer
|
string
):
The
column
comment
.
Supported
by
MySQL
,
PostgreSQL
,
Oracle
,
SQL
Server
,
SQL
Anywhere
and
Drizzl
e
.
Defaults
to
``
null
``.
Oracle
,
SQL
Server
and
SQL
Anywher
e
.
Defaults
to
``
null
``.
Vendor
specific
options
Vendor
specific
options
^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^
...
@@ -134,8 +134,8 @@ The following options are completely vendor specific and absolutely not portable
...
@@ -134,8 +134,8 @@ The following options are completely vendor specific and absolutely not portable
supported
by
some
vendors
but
not
portable
:
supported
by
some
vendors
but
not
portable
:
-
**
charset
**
(
string
):
The
character
set
to
use
for
the
column
.
Currently
only
supported
-
**
charset
**
(
string
):
The
character
set
to
use
for
the
column
.
Currently
only
supported
on
MySQL
and
Drizzle
.
on
MySQL
.
-
**
collation
**
(
string
):
The
collation
to
use
for
the
column
.
Supported
by
MySQL
,
PostgreSQL
,
-
**
collation
**
(
string
):
The
collation
to
use
for
the
column
.
Supported
by
MySQL
,
PostgreSQL
,
Sqlite
,
SQL
Server
and
Drizzle
.
Sqlite
and
SQL
Server
.
-
**
check
**
(
string
):
The
check
constraint
clause
to
add
to
the
column
.
-
**
check
**
(
string
):
The
check
constraint
clause
to
add
to
the
column
.
Defaults
to
``
null
``.
Defaults
to
``
null
``.
docs/en/reference/types.rst
View file @
857631f6
...
@@ -517,8 +517,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -517,8 +517,6 @@ Please also notice the mapping specific footnotes for additional information.
+===================+===============+==========================+=========+==========================================================+
+===================+===============+==========================+=========+==========================================================+
| **smallint** | ``integer`` | **MySQL** | *all* | ``SMALLINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| **smallint** | ``integer`` | **MySQL** | *all* | ``SMALLINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Drizzle** | *all* | ``INT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``SMALLINT`` |
| | | **PostgreSQL** | *all* | ``SMALLINT`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``NUMBER(5)`` |
| | | **Oracle** | *all* | ``NUMBER(5)`` |
...
@@ -527,11 +525,9 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -527,11 +525,9 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``SMALLINT`` ``IDENTITY`` [11]_ |
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``SMALLINT`` ``IDENTITY`` [11]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQLite** | *all* | ``INTEGER`` [1
6
]_ |
| | | **SQLite** | *all* | ``INTEGER`` [1
5
]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **integer** | ``integer`` | **MySQL** | *all* | ``INT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| **integer** | ``integer`` | **MySQL** | *all* | ``INT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``INT`` [12]_ |
| | | **PostgreSQL** | *all* | ``INT`` [12]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
...
@@ -543,12 +539,10 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -543,12 +539,10 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``INT`` ``IDENTITY`` [11]_ |
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``INT`` ``IDENTITY`` [11]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQLite** | *all* | ``INTEGER`` [1
6
]_ |
| | | **SQLite** | *all* | ``INTEGER`` [1
5
]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **bigint** | ``string`` | **MySQL** | *all* | ``BIGINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| **bigint** | ``string`` | **MySQL** | *all* | ``BIGINT`` ``UNSIGNED`` [10]_ ``AUTO_INCREMENT`` [11]_ |
| | [8]_ +--------------------------+ | |
| | [8]_ +--------------------------+---------+----------------------------------------------------------+
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``BIGINT`` [12]_ |
| | | **PostgreSQL** | *all* | ``BIGINT`` [12]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``BIGSERIAL`` [11]_ |
| | | | | ``BIGSERIAL`` [11]_ |
...
@@ -559,7 +553,7 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -559,7 +553,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``BIGINT`` ``IDENTITY`` [11]_ |
| | | **SQL Anywhere** | *all* | ``UNSIGNED`` [10]_ ``BIGINT`` ``IDENTITY`` [11]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQLite** | *all* | ``INTEGER`` [1
6
]_ |
| | | **SQLite** | *all* | ``INTEGER`` [1
5
]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **decimal** [7]_ | ``string`` | **MySQL** | *all* | ``NUMERIC(p, s)`` ``UNSIGNED`` [10]_ |
| **decimal** [7]_ | ``string`` | **MySQL** | *all* | ``NUMERIC(p, s)`` ``UNSIGNED`` [10]_ |
| | [9]_ +--------------------------+---------+----------------------------------------------------------+
| | [9]_ +--------------------------+---------+----------------------------------------------------------+
...
@@ -572,8 +566,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -572,8 +566,6 @@ Please also notice the mapping specific footnotes for additional information.
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **float** | ``float`` | **MySQL** | *all* | ``DOUBLE PRECISION`` ``UNSIGNED`` [10]_ |
| **float** | ``float`` | **MySQL** | *all* | ``DOUBLE PRECISION`` ``UNSIGNED`` [10]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
...
@@ -586,8 +578,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -586,8 +578,6 @@ Please also notice the mapping specific footnotes for additional information.
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **string** | ``string`` | **MySQL** | *all* | ``VARCHAR(n)`` [3]_ |
| **string** | ``string`` | **MySQL** | *all* | ``VARCHAR(n)`` [3]_ |
| [2]_ [5]_ | +--------------------------+ | |
| [2]_ [5]_ | +--------------------------+ | |
...
@@ -597,8 +587,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -597,8 +587,6 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Drizzle** | *all* | ``VARCHAR(n)`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``VARCHAR2(n)`` [3]_ |
| | | **Oracle** | *all* | ``VARCHAR2(n)`` [3]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``CHAR(n)`` [4]_ |
| | | | | ``CHAR(n)`` [4]_ |
...
@@ -607,19 +595,17 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -607,19 +595,17 @@ Please also notice the mapping specific footnotes for additional information.
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``NCHAR(n)`` [4]_ |
| | | | | ``NCHAR(n)`` [4]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **text** | ``string`` | **MySQL** | *all* | ``TINYTEXT`` [1
7
]_ |
| **text** | ``string`` | **MySQL** | *all* | ``TINYTEXT`` [1
6
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``TEXT`` [1
8
]_ |
| | | | | ``TEXT`` [1
7
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``MEDIUMTEXT`` [1
9
]_ |
| | | | | ``MEDIUMTEXT`` [1
8
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``LONGTEXT`` [
20
]_ |
| | | | | ``LONGTEXT`` [
19
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``CLOB`` |
| | | **Oracle** | *all* | ``CLOB`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -632,8 +618,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -632,8 +618,6 @@ Please also notice the mapping specific footnotes for additional information.
| | | **Oracle** | | |
| | | **Oracle** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``UNIQUEIDENTIFIER`` |
| | | **SQL Server** | *all* | ``UNIQUEIDENTIFIER`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -647,27 +631,23 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -647,27 +631,23 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+ | ``BINARY(n)`` [4]_ |
| | +--------------------------+ | ``BINARY(n)`` [4]_ |
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Drizzle** | *all* | ``VARBINARY(n)`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``RAW(n)`` |
| | | **Oracle** | *all* | ``RAW(n)`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``BYTEA`` [1
6
]_ |
| | | **PostgreSQL** | *all* | ``BYTEA`` [1
5
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQLite** | *all* | ``BLOB`` [1
6
]_ |
| | | **SQLite** | *all* | ``BLOB`` [1
5
]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **blob** | ``resource`` | **MySQL** | *all* | ``TINYBLOB`` [1
7
]_ |
| **blob** | ``resource`` | **MySQL** | *all* | ``TINYBLOB`` [1
6
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``BLOB`` [1
8
]_ |
| | | | | ``BLOB`` [1
7
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``MEDIUMBLOB`` [1
9
]_ |
| | | | | ``MEDIUMBLOB`` [1
8
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``LONGBLOB`` [
20
]_ |
| | | | | ``LONGBLOB`` [
19
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``BLOB`` |
| | | **Oracle** | *all* | ``BLOB`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``VARBINARY(MAX)`` |
| | | **SQL Server** | *all* | ``VARBINARY(MAX)`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
...
@@ -680,8 +660,6 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -680,8 +660,6 @@ Please also notice the mapping specific footnotes for additional information.
| | | **PostgreSQL** | *all* | ``BOOLEAN`` |
| | | **PostgreSQL** | *all* | ``BOOLEAN`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``BIT`` |
| | | **SQL Server** | *all* | ``BIT`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -698,16 +676,12 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -698,16 +676,12 @@ Please also notice the mapping specific footnotes for additional information.
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+ |
| | +--------------------------+---------+ |
| | | **SQL Server** | >= 2008 | |
| | | **SQL Server** | >= 2008 | |
| | | +---------+----------------------------------------------------------+
| | | +---------+----------------------------------------------------------+
| | | | < 2008 | ``DATETIME`` [1
6
]_ |
| | | | < 2008 | ``DATETIME`` [1
5
]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **datetime** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [13]_ |
| **datetime** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [13]_ |
| | +--------------------------+ +----------------------------------------------------------+
| | | **Drizzle** | | ``TIMESTAMP`` [14]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``DATETIME`` |
| | | **SQL Server** | *all* | ``DATETIME`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -719,9 +693,7 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -719,9 +693,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``TIMESTAMP(0)`` |
| | | **Oracle** | *all* | ``TIMESTAMP(0)`` |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **datetimetz** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [15]_ [16]_ |
| **datetimetz** | ``\DateTime`` | **MySQL** | *all* | ``DATETIME`` [14]_ [15]_ |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+---------+ |
| | +--------------------------+---------+ |
...
@@ -733,7 +705,7 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -733,7 +705,7 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **Oracle** | | |
| | | **Oracle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Anywhere** | < 12 | ``DATETIME`` [1
5]_ [16
]_ |
| | | **SQL Anywhere** | < 12 | ``DATETIME`` [1
4]_ [15
]_ |
| | | +---------+----------------------------------------------------------+
| | | +---------+----------------------------------------------------------+
| | | | >= 12 | ``TIMESTAMP WITH TIME ZONE`` |
| | | | >= 12 | ``TIMESTAMP WITH TIME ZONE`` |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
...
@@ -742,30 +714,26 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -742,30 +714,26 @@ Please also notice the mapping specific footnotes for additional information.
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQLite** | | |
| | | **SQLite** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``TIME(0) WITHOUT TIME ZONE`` |
| | | **PostgreSQL** | *all* | ``TIME(0) WITHOUT TIME ZONE`` |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``DATE`` [1
6
]_ |
| | | **Oracle** | *all* | ``DATE`` [1
5
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | < 2008 | ``DATETIME`` [1
6
]_ |
| | | **SQL Server** | < 2008 | ``DATETIME`` [1
5
]_ |
| | | +---------+----------------------------------------------------------+
| | | +---------+----------------------------------------------------------+
| | | | >= 2008 | ``TIME(0)`` |
| | | | >= 2008 | ``TIME(0)`` |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **array** [1]_ | ``array`` | **MySQL** | *all* | ``TINYTEXT`` [1
7
]_ |
| **array** [1]_ | ``array`` | **MySQL** | *all* | ``TINYTEXT`` [1
6
]_ |
+-------------------+ | | +----------------------------------------------------------+
+-------------------+ | | +----------------------------------------------------------+
| **simple array** | | | | ``TEXT`` [1
8
]_ |
| **simple array** | | | | ``TEXT`` [1
7
]_ |
| [1]_ | | | +----------------------------------------------------------+
| [1]_ | | | +----------------------------------------------------------+
| | | | | ``MEDIUMTEXT`` [1
9
]_ |
| | | | | ``MEDIUMTEXT`` [1
8
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``LONGTEXT`` [
20
]_ |
| | | | | ``LONGTEXT`` [
19
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``CLOB`` |
| | | **Oracle** | *all* | ``CLOB`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -773,25 +741,23 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -773,25 +741,23 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``VARCHAR(MAX)`` |
| | | **SQL Server** | *all* | ``VARCHAR(MAX)`` |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **json_array** | ``array`` | **MySQL** [1]_ | *all* | ``TINYTEXT`` [1
7
]_ |
| **json_array** | ``array`` | **MySQL** [1]_ | *all* | ``TINYTEXT`` [1
6
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``TEXT`` [1
8
]_ |
| | | | | ``TEXT`` [1
7
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``MEDIUMTEXT`` [1
9
]_ |
| | | | | ``MEDIUMTEXT`` [1
8
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``LONGTEXT`` [
20
]_ |
| | | | | ``LONGTEXT`` [
19
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | < 9.2 | ``TEXT`` [1]_ |
| | | **PostgreSQL** | < 9.2 | ``TEXT`` [1]_ |
| | | +---------+----------------------------------------------------------+
| | | +---------+----------------------------------------------------------+
| | | | < 9.4 | ``JSON`` |
| | | | < 9.4 | ``JSON`` |
| | | +---------+----------------------------------------------------------+
| | | +---------+----------------------------------------------------------+
| | | | >= 9.4 | ``JSON`` [2
1
]_ |
| | | | >= 9.4 | ``JSON`` [2
0
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``JSONB`` [2
2
]_ |
| | | | | ``JSONB`` [2
1
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Anywhere** | *all* | ``TEXT`` [1]_ |
| | | **SQL Anywhere** | *all* | ``TEXT`` [1]_ |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``CLOB`` [1]_ |
| | | **Oracle** | *all* | ``CLOB`` [1]_ |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -799,19 +765,17 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -799,19 +765,17 @@ Please also notice the mapping specific footnotes for additional information.
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **SQL Server** | *all* | ``VARCHAR(MAX)`` [1]_ |
| | | **SQL Server** | *all* | ``VARCHAR(MAX)`` [1]_ |
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
+-------------------+---------------+--------------------------+---------+----------------------------------------------------------+
| **object** [1]_ | ``object`` | **MySQL** | *all* | ``TINYTEXT`` [1
7
]_ |
| **object** [1]_ | ``object`` | **MySQL** | *all* | ``TINYTEXT`` [1
6
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``TEXT`` [1
8
]_ |
| | | | | ``TEXT`` [1
7
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``MEDIUMTEXT`` [1
9
]_ |
| | | | | ``MEDIUMTEXT`` [1
8
]_ |
| | | | +----------------------------------------------------------+
| | | | +----------------------------------------------------------+
| | | | | ``LONGTEXT`` [
20
]_ |
| | | | | ``LONGTEXT`` [
19
]_ |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | | **PostgreSQL** | *all* | ``TEXT`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
| | | **SQL Anywhere** | | |
| | | **SQL Anywhere** | | |
| | +--------------------------+ | |
| | | **Drizzle** | | |
| | +--------------------------+---------+----------------------------------------------------------+
| | +--------------------------+---------+----------------------------------------------------------+
| | | **Oracle** | *all* | ``CLOB`` |
| | | **Oracle** | *all* | ``CLOB`` |
| | +--------------------------+ | |
| | +--------------------------+ | |
...
@@ -827,10 +791,10 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -827,10 +791,10 @@ Please also notice the mapping specific footnotes for additional information.
.. [4] Chosen if the column definition has the **fixed** attribute set to ``true``.
.. [4] Chosen if the column definition has the **fixed** attribute set to ``true``.
.. [5] Silently maps to the vendor specific ``text`` type if the given **length** attribute for
.. [5] Silently maps to the vendor specific ``text`` type if the given **length** attribute for
**n** exceeds the maximum length the related platform allows. If this is the case, please
**n** exceeds the maximum length the related platform allows. If this is the case, please
see [1
6
]_.
see [1
5
]_.
.. [6] Silently maps to the vendor specific ``blob`` type if the given **length** attribute for
.. [6] Silently maps to the vendor specific ``blob`` type if the given **length** attribute for
**n** exceeds the maximum length the related platform allows. If this is the case, please
**n** exceeds the maximum length the related platform allows. If this is the case, please
see [1
6
]_.
see [1
5
]_.
.. [7] **p** is the precision and **s** the scale set in the column definition.
.. [7] **p** is the precision and **s** the scale set in the column definition.
The precision defaults to ``10`` and the scale to ``0`` if not set.
The precision defaults to ``10`` and the scale to ``0`` if not set.
.. [8] Returns PHP ``string`` type value instead of ``integer`` because of maximum integer value
.. [8] Returns PHP ``string`` type value instead of ``integer`` because of maximum integer value
...
@@ -842,22 +806,20 @@ Please also notice the mapping specific footnotes for additional information.
...
@@ -842,22 +806,20 @@ Please also notice the mapping specific footnotes for additional information.
.. [12] Chosen if the column definition has the **autoincrement** attribute set to ``false`` (default).
.. [12] Chosen if the column definition has the **autoincrement** attribute set to ``false`` (default).
.. [13] Chosen if the column definition does not contain the **version** option inside the **platformOptions**
.. [13] Chosen if the column definition does not contain the **version** option inside the **platformOptions**
attribute array or is set to ``false`` which marks it as a non-locking information column.
attribute array or is set to ``false`` which marks it as a non-locking information column.
.. [14] Chosen if the column definition contains the **version** option inside the **platformOptions**
.. [14] Fallback type as the vendor does not support a native date time type with timezone information.
attribute array and is set to ``true`` which marks it as a locking information column.
.. [15] Fallback type as the vendor does not support a native date time type with timezone information.
This means that the timezone information gets lost when storing a value.
This means that the timezone information gets lost when storing a value.
.. [1
6
] Cannot be safely reverse engineered to the same Doctrine type as the vendor does not have a
.. [1
5
] Cannot be safely reverse engineered to the same Doctrine type as the vendor does not have a
native distinct data type for this mapping. Using this type with this vendor can therefore
native distinct data type for this mapping. Using this type with this vendor can therefore
have implications on schema comparison (*online* vs *offline* schema) and PHP type safety
have implications on schema comparison (*online* vs *offline* schema) and PHP type safety
(data conversion from database to PHP value) because it silently falls back to its
(data conversion from database to PHP value) because it silently falls back to its
appropriate Doctrine type.
appropriate Doctrine type.
.. [1
7
] Chosen if the column length is less or equal to **2 ^ 8 - 1 = 255**.
.. [1
6
] Chosen if the column length is less or equal to **2 ^ 8 - 1 = 255**.
.. [1
8
] Chosen if the column length is less or equal to **2 ^ 16 - 1 = 65535**.
.. [1
7
] Chosen if the column length is less or equal to **2 ^ 16 - 1 = 65535**.
.. [1
9
] Chosen if the column length is less or equal to **2 ^ 24 - 1 = 16777215**.
.. [1
8
] Chosen if the column length is less or equal to **2 ^ 24 - 1 = 16777215**.
.. [
20
] Chosen if the column length is less or equal to **2 ^ 32 - 1 = 4294967295** or empty.
.. [
19
] Chosen if the column length is less or equal to **2 ^ 32 - 1 = 4294967295** or empty.
.. [2
1
] Chosen if the column definition does not contain the **jsonb** option inside the **platformOptions**
.. [2
0
] Chosen if the column definition does not contain the **jsonb** option inside the **platformOptions**
attribute array or is set to ``false``.
attribute array or is set to ``false``.
.. [2
2
] Chosen if the column definition contains the **jsonb** option inside the **platformOptions**
.. [2
1
] Chosen if the column definition contains the **jsonb** option inside the **platformOptions**
attribute array and is set to ``true``.
attribute array and is set to ``true``.
Detection of Database Types
Detection of Database Types
...
...
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Connection.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\DBAL\Driver\DrizzlePDOMySql
;
use
Doctrine\DBAL\Driver\PDOConnection
;
use
Doctrine\DBAL\ParameterType
;
class
Connection
extends
PDOConnection
{
/**
* {@inheritdoc}
*/
public
function
quote
(
$value
,
$type
=
ParameterType
::
STRING
)
{
if
(
$type
===
ParameterType
::
BOOLEAN
)
{
return
$value
?
'true'
:
'false'
;
}
return
parent
::
quote
(
$value
,
$type
);
}
}
lib/Doctrine/DBAL/Driver/DrizzlePDOMySql/Driver.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\DBAL\Driver\DrizzlePDOMySql
;
use
Doctrine\DBAL\Platforms\DrizzlePlatform
;
use
Doctrine\DBAL\Schema\DrizzleSchemaManager
;
/**
* Drizzle driver using PDO MySql.
*/
class
Driver
extends
\Doctrine\DBAL\Driver\PDOMySql\Driver
{
/**
* {@inheritdoc}
*/
public
function
connect
(
array
$params
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
[])
{
return
new
Connection
(
$this
->
constructPdoDsn
(
$params
),
$username
,
$password
,
$driverOptions
);
}
/**
* {@inheritdoc}
*/
public
function
createDatabasePlatformForVersion
(
$version
)
{
return
$this
->
getDatabasePlatform
();
}
/**
* {@inheritdoc}
*/
public
function
getDatabasePlatform
()
{
return
new
DrizzlePlatform
();
}
/**
* {@inheritdoc}
*/
public
function
getSchemaManager
(
\Doctrine\DBAL\Connection
$conn
)
{
return
new
DrizzleSchemaManager
(
$conn
);
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public
function
getName
()
{
return
'drizzle_pdo_mysql'
;
}
}
lib/Doctrine/DBAL/DriverManager.php
View file @
857631f6
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
namespace
Doctrine\DBAL
;
namespace
Doctrine\DBAL
;
use
Doctrine\Common\EventManager
;
use
Doctrine\Common\EventManager
;
use
Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver
as
DrizzlePDOMySQLDriver
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Driver
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Driver
;
use
Doctrine\DBAL\Driver\Mysqli\Driver
as
MySQLiDriver
;
use
Doctrine\DBAL\Driver\Mysqli\Driver
as
MySQLiDriver
;
use
Doctrine\DBAL\Driver\OCI8\Driver
as
OCI8Driver
;
use
Doctrine\DBAL\Driver\OCI8\Driver
as
OCI8Driver
;
...
@@ -44,17 +43,16 @@ final class DriverManager
...
@@ -44,17 +43,16 @@ final class DriverManager
* @var string[]
* @var string[]
*/
*/
private
static
$_driverMap
=
[
private
static
$_driverMap
=
[
'pdo_mysql'
=>
PDOMySQLDriver
::
class
,
'pdo_mysql'
=>
PDOMySQLDriver
::
class
,
'pdo_sqlite'
=>
PDOSQLiteDriver
::
class
,
'pdo_sqlite'
=>
PDOSQLiteDriver
::
class
,
'pdo_pgsql'
=>
PDOPgSQLDriver
::
class
,
'pdo_pgsql'
=>
PDOPgSQLDriver
::
class
,
'pdo_oci'
=>
PDOOCIDriver
::
class
,
'pdo_oci'
=>
PDOOCIDriver
::
class
,
'oci8'
=>
OCI8Driver
::
class
,
'oci8'
=>
OCI8Driver
::
class
,
'ibm_db2'
=>
DB2Driver
::
class
,
'ibm_db2'
=>
DB2Driver
::
class
,
'pdo_sqlsrv'
=>
PDOSQLSrvDriver
::
class
,
'pdo_sqlsrv'
=>
PDOSQLSrvDriver
::
class
,
'mysqli'
=>
MySQLiDriver
::
class
,
'mysqli'
=>
MySQLiDriver
::
class
,
'drizzle_pdo_mysql'
=>
DrizzlePDOMySQLDriver
::
class
,
'sqlanywhere'
=>
SQLAnywhereDriver
::
class
,
'sqlanywhere'
=>
SQLAnywhereDriver
::
class
,
'sqlsrv'
=>
SQLSrvDriver
::
class
,
'sqlsrv'
=>
SQLSrvDriver
::
class
,
];
];
/**
/**
...
@@ -100,7 +98,6 @@ final class DriverManager
...
@@ -100,7 +98,6 @@ final class DriverManager
* sqlanywhere
* sqlanywhere
* sqlsrv
* sqlsrv
* ibm_db2 (unstable)
* ibm_db2 (unstable)
* drizzle_pdo_mysql
*
*
* OR 'driverClass' that contains the full class name (with namespace) of the
* OR 'driverClass' that contains the full class name (with namespace) of the
* driver class to instantiate.
* driver class to instantiate.
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\Schema\Identifier
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Types\BinaryType
;
use
InvalidArgumentException
;
use
function
array_merge
;
use
function
array_unique
;
use
function
array_values
;
use
function
count
;
use
function
func_get_args
;
use
function
implode
;
use
function
is_array
;
use
function
is_bool
;
use
function
is_numeric
;
use
function
is_string
;
use
function
sprintf
;
use
function
trim
;
/**
* Drizzle platform
*/
class
DrizzlePlatform
extends
AbstractPlatform
{
/**
* {@inheritDoc}
*/
public
function
getName
()
{
return
'drizzle'
;
}
/**
* {@inheritDoc}
*/
public
function
getIdentifierQuoteCharacter
()
{
return
'`'
;
}
/**
* {@inheritDoc}
*/
public
function
getConcatExpression
()
{
return
'CONCAT('
.
implode
(
', '
,
func_get_args
())
.
')'
;
}
/**
* {@inheritdoc}
*/
protected
function
getDateArithmeticIntervalExpression
(
$date
,
$operator
,
$interval
,
$unit
)
{
$function
=
$operator
===
'+'
?
'DATE_ADD'
:
'DATE_SUB'
;
return
$function
.
'('
.
$date
.
', INTERVAL '
.
$interval
.
' '
.
$unit
.
')'
;
}
/**
* {@inheritDoc}
*/
public
function
getDateDiffExpression
(
$date1
,
$date2
)
{
return
'DATEDIFF('
.
$date1
.
', '
.
$date2
.
')'
;
}
/**
* {@inheritDoc}
*/
public
function
getBooleanTypeDeclarationSQL
(
array
$field
)
{
return
'BOOLEAN'
;
}
/**
* {@inheritDoc}
*/
public
function
getIntegerTypeDeclarationSQL
(
array
$field
)
{
return
'INT'
.
$this
->
_getCommonIntegerTypeDeclarationSQL
(
$field
);
}
/**
* {@inheritDoc}
*/
protected
function
_getCommonIntegerTypeDeclarationSQL
(
array
$columnDef
)
{
$autoinc
=
''
;
if
(
!
empty
(
$columnDef
[
'autoincrement'
]))
{
$autoinc
=
' AUTO_INCREMENT'
;
}
return
$autoinc
;
}
/**
* {@inheritDoc}
*/
public
function
getBigIntTypeDeclarationSQL
(
array
$field
)
{
return
'BIGINT'
.
$this
->
_getCommonIntegerTypeDeclarationSQL
(
$field
);
}
/**
* {@inheritDoc}
*/
public
function
getSmallIntTypeDeclarationSQL
(
array
$field
)
{
return
'INT'
.
$this
->
_getCommonIntegerTypeDeclarationSQL
(
$field
);
}
/**
* {@inheritDoc}
*/
protected
function
getVarcharTypeDeclarationSQLSnippet
(
$length
,
$fixed
)
{
return
$length
?
'VARCHAR('
.
$length
.
')'
:
'VARCHAR(255)'
;
}
/**
* {@inheritdoc}
*/
protected
function
getBinaryTypeDeclarationSQLSnippet
(
$length
,
$fixed
)
{
return
'VARBINARY('
.
(
$length
?:
255
)
.
')'
;
}
/**
* {@inheritDoc}
*/
protected
function
initializeDoctrineTypeMappings
()
{
$this
->
doctrineTypeMapping
=
[
'boolean'
=>
'boolean'
,
'varchar'
=>
'string'
,
'varbinary'
=>
'binary'
,
'integer'
=>
'integer'
,
'blob'
=>
'blob'
,
'decimal'
=>
'decimal'
,
'datetime'
=>
'datetime'
,
'date'
=>
'date'
,
'time'
=>
'time'
,
'text'
=>
'text'
,
'timestamp'
=>
'datetime'
,
'double'
=>
'float'
,
'bigint'
=>
'bigint'
,
];
}
/**
* {@inheritDoc}
*/
public
function
getClobTypeDeclarationSQL
(
array
$field
)
{
return
'TEXT'
;
}
/**
* {@inheritDoc}
*/
public
function
getBlobTypeDeclarationSQL
(
array
$field
)
{
return
'BLOB'
;
}
/**
* {@inheritDoc}
*/
public
function
getCreateDatabaseSQL
(
$name
)
{
return
'CREATE DATABASE '
.
$name
;
}
/**
* {@inheritDoc}
*/
public
function
getDropDatabaseSQL
(
$name
)
{
return
'DROP DATABASE '
.
$name
;
}
/**
* {@inheritDoc}
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
[])
{
$queryFields
=
$this
->
getColumnDeclarationListSQL
(
$columns
);
if
(
isset
(
$options
[
'uniqueConstraints'
])
&&
!
empty
(
$options
[
'uniqueConstraints'
]))
{
foreach
(
$options
[
'uniqueConstraints'
]
as
$name
=>
$definition
)
{
$queryFields
.=
', '
.
$this
->
getUniqueConstraintDeclarationSQL
(
$name
,
$definition
);
}
}
// add all indexes
if
(
isset
(
$options
[
'indexes'
])
&&
!
empty
(
$options
[
'indexes'
]))
{
foreach
(
$options
[
'indexes'
]
as
$index
=>
$definition
)
{
$queryFields
.=
', '
.
$this
->
getIndexDeclarationSQL
(
$index
,
$definition
);
}
}
// attach all primary keys
if
(
isset
(
$options
[
'primary'
])
&&
!
empty
(
$options
[
'primary'
]))
{
$keyColumns
=
array_unique
(
array_values
(
$options
[
'primary'
]));
$queryFields
.=
', PRIMARY KEY('
.
implode
(
', '
,
$keyColumns
)
.
')'
;
}
$query
=
'CREATE '
;
if
(
!
empty
(
$options
[
'temporary'
]))
{
$query
.=
'TEMPORARY '
;
}
$query
.=
'TABLE '
.
$tableName
.
' ('
.
$queryFields
.
') '
;
$query
.=
$this
->
buildTableOptions
(
$options
);
$query
.=
$this
->
buildPartitionOptions
(
$options
);
$sql
=
[
$query
];
if
(
isset
(
$options
[
'foreignKeys'
]))
{
foreach
((
array
)
$options
[
'foreignKeys'
]
as
$definition
)
{
$sql
[]
=
$this
->
getCreateForeignKeySQL
(
$definition
,
$tableName
);
}
}
return
$sql
;
}
/**
* Build SQL for table options
*
* @param mixed[] $options
*
* @return string
*/
private
function
buildTableOptions
(
array
$options
)
{
if
(
isset
(
$options
[
'table_options'
]))
{
return
$options
[
'table_options'
];
}
$tableOptions
=
[];
// Collate
if
(
!
isset
(
$options
[
'collate'
]))
{
$options
[
'collate'
]
=
'utf8_unicode_ci'
;
}
$tableOptions
[]
=
sprintf
(
'COLLATE %s'
,
$options
[
'collate'
]);
// Engine
if
(
!
isset
(
$options
[
'engine'
]))
{
$options
[
'engine'
]
=
'InnoDB'
;
}
$tableOptions
[]
=
sprintf
(
'ENGINE = %s'
,
$options
[
'engine'
]);
// Auto increment
if
(
isset
(
$options
[
'auto_increment'
]))
{
$tableOptions
[]
=
sprintf
(
'AUTO_INCREMENT = %s'
,
$options
[
'auto_increment'
]);
}
// Comment
if
(
isset
(
$options
[
'comment'
]))
{
$comment
=
trim
(
$options
[
'comment'
],
" '"
);
$tableOptions
[]
=
sprintf
(
'COMMENT = %s '
,
$this
->
quoteStringLiteral
(
$comment
));
}
// Row format
if
(
isset
(
$options
[
'row_format'
]))
{
$tableOptions
[]
=
sprintf
(
'ROW_FORMAT = %s'
,
$options
[
'row_format'
]);
}
return
implode
(
' '
,
$tableOptions
);
}
/**
* Build SQL for partition options.
*
* @param mixed[] $options
*
* @return string
*/
private
function
buildPartitionOptions
(
array
$options
)
{
return
isset
(
$options
[
'partition_options'
])
?
' '
.
$options
[
'partition_options'
]
:
''
;
}
/**
* {@inheritDoc}
*/
public
function
getListDatabasesSQL
()
{
return
"SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE CATALOG_NAME='LOCAL'"
;
}
/**
* {@inheritDoc}
*/
protected
function
getReservedKeywordsClass
()
{
return
Keywords\DrizzleKeywords
::
class
;
}
/**
* {@inheritDoc}
*/
public
function
getListTablesSQL
()
{
return
"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE' AND TABLE_SCHEMA=DATABASE()"
;
}
/**
* {@inheritDoc}
*/
public
function
getListTableColumnsSQL
(
$table
,
$database
=
null
)
{
if
(
$database
)
{
$databaseSQL
=
$this
->
quoteStringLiteral
(
$database
);
}
else
{
$databaseSQL
=
'DATABASE()'
;
}
return
'SELECT COLUMN_NAME, DATA_TYPE, COLUMN_COMMENT, IS_NULLABLE, IS_AUTO_INCREMENT, CHARACTER_MAXIMUM_LENGTH, COLUMN_DEFAULT,'
.
' NUMERIC_PRECISION, NUMERIC_SCALE, COLLATION_NAME'
.
' FROM DATA_DICTIONARY.COLUMNS'
.
' WHERE TABLE_SCHEMA='
.
$databaseSQL
.
' AND TABLE_NAME = '
.
$this
->
quoteStringLiteral
(
$table
);
}
/**
* {@inheritDoc}
*/
public
function
getListTableForeignKeysSQL
(
$table
,
$database
=
null
)
{
if
(
$database
)
{
$databaseSQL
=
$this
->
quoteStringLiteral
(
$database
);
}
else
{
$databaseSQL
=
'DATABASE()'
;
}
return
'SELECT CONSTRAINT_NAME, CONSTRAINT_COLUMNS, REFERENCED_TABLE_NAME, REFERENCED_TABLE_COLUMNS, UPDATE_RULE, DELETE_RULE'
.
' FROM DATA_DICTIONARY.FOREIGN_KEYS'
.
' WHERE CONSTRAINT_SCHEMA='
.
$databaseSQL
.
' AND CONSTRAINT_TABLE='
.
$this
->
quoteStringLiteral
(
$table
);
}
/**
* {@inheritDoc}
*/
public
function
getListTableIndexesSQL
(
$table
,
$database
=
null
)
{
if
(
$database
)
{
$databaseSQL
=
$this
->
quoteStringLiteral
(
$database
);
}
else
{
$databaseSQL
=
'DATABASE()'
;
}
return
"SELECT INDEX_NAME AS 'key_name', COLUMN_NAME AS 'column_name', IS_USED_IN_PRIMARY AS 'primary', IS_UNIQUE=0 AS 'non_unique'"
.
' FROM DATA_DICTIONARY.INDEX_PARTS'
.
' WHERE TABLE_SCHEMA='
.
$databaseSQL
.
' AND TABLE_NAME='
.
$this
->
quoteStringLiteral
(
$table
);
}
/**
* {@inheritDoc}
*/
public
function
prefersIdentityColumns
()
{
return
true
;
}
/**
* {@inheritDoc}
*/
public
function
supportsIdentityColumns
()
{
return
true
;
}
/**
* {@inheritDoc}
*/
public
function
supportsInlineColumnComments
()
{
return
true
;
}
/**
* {@inheritDoc}
*/
public
function
supportsViews
()
{
return
false
;
}
/**
* {@inheritdoc}
*/
public
function
supportsColumnCollation
()
{
return
true
;
}
/**
* {@inheritDoc}
*/
public
function
getDropIndexSQL
(
$index
,
$table
=
null
)
{
if
(
$index
instanceof
Index
)
{
$indexName
=
$index
->
getQuotedName
(
$this
);
}
elseif
(
is_string
(
$index
))
{
$indexName
=
$index
;
}
else
{
throw
new
InvalidArgumentException
(
'DrizzlePlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'
);
}
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'DrizzlePlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
}
if
(
$index
instanceof
Index
&&
$index
->
isPrimary
())
{
// drizzle primary keys are always named "PRIMARY",
// so we cannot use them in statements because of them being keyword.
return
$this
->
getDropPrimaryKeySQL
(
$table
);
}
return
'DROP INDEX '
.
$indexName
.
' ON '
.
$table
;
}
/**
* {@inheritDoc}
*/
protected
function
getDropPrimaryKeySQL
(
$table
)
{
return
'ALTER TABLE '
.
$table
.
' DROP PRIMARY KEY'
;
}
/**
* {@inheritDoc}
*/
public
function
getDateTimeTypeDeclarationSQL
(
array
$fieldDeclaration
)
{
if
(
isset
(
$fieldDeclaration
[
'version'
])
&&
$fieldDeclaration
[
'version'
]
===
true
)
{
return
'TIMESTAMP'
;
}
return
'DATETIME'
;
}
/**
* {@inheritDoc}
*/
public
function
getTimeTypeDeclarationSQL
(
array
$fieldDeclaration
)
{
return
'TIME'
;
}
/**
* {@inheritDoc}
*/
public
function
getDateTypeDeclarationSQL
(
array
$fieldDeclaration
)
{
return
'DATE'
;
}
/**
* {@inheritDoc}
*/
public
function
getAlterTableSQL
(
TableDiff
$diff
)
{
$columnSql
=
[];
$queryParts
=
[];
$newName
=
$diff
->
getNewName
();
if
(
$newName
!==
false
)
{
$queryParts
[]
=
'RENAME TO '
.
$newName
->
getQuotedName
(
$this
);
}
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
}
$columnArray
=
$column
->
toArray
();
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$queryParts
[]
=
'ADD '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
foreach
(
$diff
->
removedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableRemoveColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
}
$queryParts
[]
=
'DROP '
.
$column
->
getQuotedName
(
$this
);
}
foreach
(
$diff
->
changedColumns
as
$columnDiff
)
{
if
(
$this
->
onSchemaAlterTableChangeColumn
(
$columnDiff
,
$diff
,
$columnSql
))
{
continue
;
}
$column
=
$columnDiff
->
column
;
$columnArray
=
$column
->
toArray
();
// Do not generate column alteration clause if type is binary and only fixed property has changed.
// Drizzle only supports binary type columns with variable length.
// Avoids unnecessary table alteration statements.
if
(
$columnArray
[
'type'
]
instanceof
BinaryType
&&
$columnDiff
->
hasChanged
(
'fixed'
)
&&
count
(
$columnDiff
->
changedProperties
)
===
1
)
{
continue
;
}
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$queryParts
[]
=
'CHANGE '
.
(
$columnDiff
->
getOldColumnName
()
->
getQuotedName
(
$this
))
.
' '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
foreach
(
$diff
->
renamedColumns
as
$oldColumnName
=>
$column
)
{
if
(
$this
->
onSchemaAlterTableRenameColumn
(
$oldColumnName
,
$column
,
$diff
,
$columnSql
))
{
continue
;
}
$oldColumnName
=
new
Identifier
(
$oldColumnName
);
$columnArray
=
$column
->
toArray
();
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$queryParts
[]
=
'CHANGE '
.
$oldColumnName
->
getQuotedName
(
$this
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
$sql
=
[];
$tableSql
=
[];
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
(
$this
)
->
getQuotedName
(
$this
)
.
' '
.
implode
(
', '
,
$queryParts
);
}
$sql
=
array_merge
(
$this
->
getPreAlterTableIndexForeignKeySQL
(
$diff
),
$sql
,
$this
->
getPostAlterTableIndexForeignKeySQL
(
$diff
)
);
}
return
array_merge
(
$sql
,
$tableSql
,
$columnSql
);
}
/**
* {@inheritDoc}
*/
public
function
getDropTemporaryTableSQL
(
$table
)
{
if
(
$table
instanceof
Table
)
{
$table
=
$table
->
getQuotedName
(
$this
);
}
elseif
(
!
is_string
(
$table
))
{
throw
new
InvalidArgumentException
(
'getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
}
return
'DROP TEMPORARY TABLE '
.
$table
;
}
/**
* {@inheritDoc}
*/
public
function
convertBooleans
(
$item
)
{
if
(
is_array
(
$item
))
{
foreach
(
$item
as
$key
=>
$value
)
{
if
(
!
is_bool
(
$value
)
&&
!
is_numeric
(
$value
))
{
continue
;
}
$item
[
$key
]
=
$value
?
'true'
:
'false'
;
}
}
elseif
(
is_bool
(
$item
)
||
is_numeric
(
$item
))
{
$item
=
$item
?
'true'
:
'false'
;
}
return
$item
;
}
/**
* {@inheritDoc}
*/
public
function
getLocateExpression
(
$str
,
$substr
,
$startPos
=
false
)
{
if
(
$startPos
===
false
)
{
return
'LOCATE('
.
$substr
.
', '
.
$str
.
')'
;
}
return
'LOCATE('
.
$substr
.
', '
.
$str
.
', '
.
$startPos
.
')'
;
}
/**
* {@inheritDoc}
*
* @deprecated Use application-generated UUIDs instead
*/
public
function
getGuidExpression
()
{
return
'UUID()'
;
}
/**
* {@inheritDoc}
*/
public
function
getRegexpExpression
()
{
return
'RLIKE'
;
}
}
lib/Doctrine/DBAL/Platforms/Keywords/DrizzleKeywords.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\DBAL\Platforms\Keywords
;
/**
* Drizzle Keywordlist.
*/
class
DrizzleKeywords
extends
KeywordList
{
/**
* {@inheritdoc}
*/
public
function
getName
()
{
return
'drizzle'
;
}
/**
* {@inheritdoc}
*/
protected
function
getKeywords
()
{
return
[
'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'
,
];
}
}
lib/Doctrine/DBAL/Portability/Connection.php
View file @
857631f6
...
@@ -26,7 +26,6 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -26,7 +26,6 @@ class Connection extends \Doctrine\DBAL\Connection
public
const
PORTABILITY_POSTGRESQL
=
13
;
public
const
PORTABILITY_POSTGRESQL
=
13
;
public
const
PORTABILITY_SQLITE
=
13
;
public
const
PORTABILITY_SQLITE
=
13
;
public
const
PORTABILITY_OTHERVENDORS
=
12
;
public
const
PORTABILITY_OTHERVENDORS
=
12
;
public
const
PORTABILITY_DRIZZLE
=
13
;
public
const
PORTABILITY_SQLANYWHERE
=
13
;
public
const
PORTABILITY_SQLANYWHERE
=
13
;
public
const
PORTABILITY_SQLSRV
=
13
;
public
const
PORTABILITY_SQLSRV
=
13
;
...
@@ -51,8 +50,6 @@ class Connection extends \Doctrine\DBAL\Connection
...
@@ -51,8 +50,6 @@ class Connection extends \Doctrine\DBAL\Connection
$params
[
'portability'
]
&=
self
::
PORTABILITY_POSTGRESQL
;
$params
[
'portability'
]
&=
self
::
PORTABILITY_POSTGRESQL
;
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'sqlite'
)
{
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'sqlite'
)
{
$params
[
'portability'
]
&=
self
::
PORTABILITY_SQLITE
;
$params
[
'portability'
]
&=
self
::
PORTABILITY_SQLITE
;
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'drizzle'
)
{
$params
[
'portability'
]
&=
self
::
PORTABILITY_DRIZZLE
;
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'sqlanywhere'
)
{
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'sqlanywhere'
)
{
$params
[
'portability'
]
&=
self
::
PORTABILITY_SQLANYWHERE
;
$params
[
'portability'
]
&=
self
::
PORTABILITY_SQLANYWHERE
;
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'db2'
)
{
}
elseif
(
$this
->
getDatabasePlatform
()
->
getName
()
===
'db2'
)
{
...
...
lib/Doctrine/DBAL/Schema/DrizzleSchemaManager.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Types\Type
;
use
function
explode
;
use
function
strtolower
;
use
function
trim
;
/**
* Schema manager for the Drizzle RDBMS.
*/
class
DrizzleSchemaManager
extends
AbstractSchemaManager
{
/**
* {@inheritdoc}
*/
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{
$dbType
=
strtolower
(
$tableColumn
[
'DATA_TYPE'
]);
$type
=
$this
->
_platform
->
getDoctrineTypeMapping
(
$dbType
);
$type
=
$this
->
extractDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$tableColumn
[
'COLUMN_COMMENT'
]
=
$this
->
removeDoctrineTypeFromComment
(
$tableColumn
[
'COLUMN_COMMENT'
],
$type
);
$options
=
[
'notnull'
=>
!
(
bool
)
$tableColumn
[
'IS_NULLABLE'
],
'length'
=>
(
int
)
$tableColumn
[
'CHARACTER_MAXIMUM_LENGTH'
],
'default'
=>
$tableColumn
[
'COLUMN_DEFAULT'
]
??
null
,
'autoincrement'
=>
(
bool
)
$tableColumn
[
'IS_AUTO_INCREMENT'
],
'scale'
=>
(
int
)
$tableColumn
[
'NUMERIC_SCALE'
],
'precision'
=>
(
int
)
$tableColumn
[
'NUMERIC_PRECISION'
],
'comment'
=>
isset
(
$tableColumn
[
'COLUMN_COMMENT'
])
&&
$tableColumn
[
'COLUMN_COMMENT'
]
!==
''
?
$tableColumn
[
'COLUMN_COMMENT'
]
:
null
,
];
$column
=
new
Column
(
$tableColumn
[
'COLUMN_NAME'
],
Type
::
getType
(
$type
),
$options
);
if
(
!
empty
(
$tableColumn
[
'COLLATION_NAME'
]))
{
$column
->
setPlatformOption
(
'collation'
,
$tableColumn
[
'COLLATION_NAME'
]);
}
return
$column
;
}
/**
* {@inheritdoc}
*/
protected
function
_getPortableDatabaseDefinition
(
$database
)
{
return
$database
[
'SCHEMA_NAME'
];
}
/**
* {@inheritdoc}
*/
protected
function
_getPortableTableDefinition
(
$table
)
{
return
$table
[
'TABLE_NAME'
];
}
/**
* {@inheritdoc}
*/
public
function
_getPortableTableForeignKeyDefinition
(
$tableForeignKey
)
{
$columns
=
[];
foreach
(
explode
(
','
,
$tableForeignKey
[
'CONSTRAINT_COLUMNS'
])
as
$value
)
{
$columns
[]
=
trim
(
$value
,
' `'
);
}
$refColumns
=
[];
foreach
(
explode
(
','
,
$tableForeignKey
[
'REFERENCED_TABLE_COLUMNS'
])
as
$value
)
{
$refColumns
[]
=
trim
(
$value
,
' `'
);
}
return
new
ForeignKeyConstraint
(
$columns
,
$tableForeignKey
[
'REFERENCED_TABLE_NAME'
],
$refColumns
,
$tableForeignKey
[
'CONSTRAINT_NAME'
],
[
'onUpdate'
=>
$tableForeignKey
[
'UPDATE_RULE'
],
'onDelete'
=>
$tableForeignKey
[
'DELETE_RULE'
],
]
);
}
/**
* {@inheritdoc}
*/
protected
function
_getPortableTableIndexesList
(
$tableIndexes
,
$tableName
=
null
)
{
$indexes
=
[];
foreach
(
$tableIndexes
as
$k
)
{
$k
[
'primary'
]
=
(
bool
)
$k
[
'primary'
];
$indexes
[]
=
$k
;
}
return
parent
::
_getPortableTableIndexesList
(
$indexes
,
$tableName
);
}
}
tests/Doctrine/Tests/DBAL/Driver/DrizzlePDOMySql/DriverTest.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\Tests\DBAL\Driver\DrizzlePDOMySql
;
use
Doctrine\DBAL\Connection
;
use
Doctrine\DBAL\Driver
as
DriverInterface
;
use
Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver
;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
use
Doctrine\DBAL\Platforms\DrizzlePlatform
;
use
Doctrine\DBAL\Schema\AbstractSchemaManager
;
use
Doctrine\DBAL\Schema\DrizzleSchemaManager
;
use
Doctrine\Tests\DBAL\Driver\PDOMySql\DriverTest
as
PDOMySQLDriverTest
;
class
DriverTest
extends
PDOMySQLDriverTest
{
public
function
testReturnsName
()
:
void
{
self
::
assertSame
(
'drizzle_pdo_mysql'
,
$this
->
driver
->
getName
());
}
public
function
testThrowsExceptionOnCreatingDatabasePlatformsForInvalidVersion
()
:
void
{
$this
->
markTestSkipped
(
'This test does not work on Drizzle as it is not version aware.'
);
}
protected
function
createDriver
()
:
DriverInterface
{
return
new
Driver
();
}
protected
function
createPlatform
()
:
AbstractPlatform
{
return
new
DrizzlePlatform
();
}
protected
function
createSchemaManager
(
Connection
$connection
)
:
AbstractSchemaManager
{
return
new
DrizzleSchemaManager
(
$connection
);
}
/**
* @return mixed[][]
*/
protected
function
getDatabasePlatformsForVersions
()
:
array
{
return
[
[
'foo'
,
DrizzlePlatform
::
class
],
[
'bar'
,
DrizzlePlatform
::
class
],
[
'baz'
,
DrizzlePlatform
::
class
],
];
}
}
tests/Doctrine/Tests/DBAL/DriverManagerTest.php
View file @
857631f6
...
@@ -6,7 +6,6 @@ use Doctrine\DBAL\Connection;
...
@@ -6,7 +6,6 @@ use Doctrine\DBAL\Connection;
use
Doctrine\DBAL\Connections\MasterSlaveConnection
;
use
Doctrine\DBAL\Connections\MasterSlaveConnection
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Driver
;
use
Doctrine\DBAL\Driver\DrizzlePDOMySql\Driver
as
DrizzlePDOMySqlDriver
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
as
PDOMySQLDriver
;
use
Doctrine\DBAL\Driver\PDOMySql\Driver
as
PDOMySQLDriver
;
use
Doctrine\DBAL\Driver\PDOSqlite\Driver
as
PDOSqliteDriver
;
use
Doctrine\DBAL\Driver\PDOSqlite\Driver
as
PDOSqliteDriver
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
as
SQLSrvDriver
;
use
Doctrine\DBAL\Driver\SQLSrv\Driver
as
SQLSrvDriver
;
...
@@ -355,17 +354,17 @@ class DriverManagerTest extends DbalTestCase
...
@@ -355,17 +354,17 @@ class DriverManagerTest extends DbalTestCase
],
],
],
],
'simple URL with fallthrough scheme containing underscores fails'
=>
[
'simple URL with fallthrough scheme containing underscores fails'
=>
[
'
drizzle_
pdo_mysql://foo:bar@localhost/baz'
,
'pdo_mysql://foo:bar@localhost/baz'
,
false
,
false
,
],
],
'simple URL with fallthrough scheme containing dashes works'
=>
[
'simple URL with fallthrough scheme containing dashes works'
=>
[
'
drizzle-
pdo-mysql://foo:bar@localhost/baz'
,
'pdo-mysql://foo:bar@localhost/baz'
,
[
[
'user'
=>
'foo'
,
'user'
=>
'foo'
,
'password'
=>
'bar'
,
'password'
=>
'bar'
,
'host'
=>
'localhost'
,
'host'
=>
'localhost'
,
'dbname'
=>
'baz'
,
'dbname'
=>
'baz'
,
'driver'
=>
DrizzlePDOMySql
Driver
::
class
,
'driver'
=>
PDOMySQL
Driver
::
class
,
],
],
],
],
'simple URL with percent encoding'
=>
[
'simple URL with percent encoding'
=>
[
...
...
tests/Doctrine/Tests/DBAL/Functional/ExceptionTest.php
View file @
857631f6
...
@@ -6,7 +6,6 @@ use Doctrine\DBAL\Driver\ExceptionConverterDriver;
...
@@ -6,7 +6,6 @@ use Doctrine\DBAL\Driver\ExceptionConverterDriver;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\Driver\ServerInfoAwareConnection
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\DriverManager
;
use
Doctrine\DBAL\Exception
;
use
Doctrine\DBAL\Exception
;
use
Doctrine\DBAL\Platforms\DrizzlePlatform
;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
use
Doctrine\DBAL\Platforms\SqlitePlatform
;
...
@@ -357,10 +356,6 @@ EOT
...
@@ -357,10 +356,6 @@ EOT
$this
->
markTestSkipped
(
'Only skipped if platform is not sqlite'
);
$this
->
markTestSkipped
(
'Only skipped if platform is not sqlite'
);
}
}
if
(
$platform
instanceof
DrizzlePlatform
)
{
$this
->
markTestSkipped
(
'Drizzle does not always support authentication'
);
}
if
(
$platform
instanceof
PostgreSqlPlatform
&&
isset
(
$params
[
'password'
]))
{
if
(
$platform
instanceof
PostgreSqlPlatform
&&
isset
(
$params
[
'password'
]))
{
$this
->
markTestSkipped
(
'Does not work on Travis'
);
$this
->
markTestSkipped
(
'Does not work on Travis'
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php
deleted
100644 → 0
View file @
cb6710c9
<?php
namespace
Doctrine\Tests\DBAL\Functional\Schema
;
use
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Types\BinaryType
;
class
DrizzleSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
public
function
testListTableWithBinary
()
:
void
{
$tableName
=
'test_binary_table'
;
$table
=
new
Table
(
$tableName
);
$table
->
addColumn
(
'id'
,
'integer'
);
$table
->
addColumn
(
'column_varbinary'
,
'binary'
,
[]);
$table
->
addColumn
(
'column_binary'
,
'binary'
,
[
'fixed'
=>
true
]);
$table
->
setPrimaryKey
([
'id'
]);
$this
->
schemaManager
->
createTable
(
$table
);
$table
=
$this
->
schemaManager
->
listTableDetails
(
$tableName
);
self
::
assertInstanceOf
(
BinaryType
::
class
,
$table
->
getColumn
(
'column_varbinary'
)
->
getType
());
self
::
assertFalse
(
$table
->
getColumn
(
'column_varbinary'
)
->
getFixed
());
self
::
assertInstanceOf
(
BinaryType
::
class
,
$table
->
getColumn
(
'column_binary'
)
->
getType
());
self
::
assertFalse
(
$table
->
getColumn
(
'column_binary'
)
->
getFixed
());
}
public
function
testColumnCollation
()
:
void
{
$table
=
new
Table
(
'test_collation'
);
$table
->
addOption
(
'collate'
,
$collation
=
'utf8_unicode_ci'
);
$table
->
addColumn
(
'id'
,
'integer'
);
$table
->
addColumn
(
'text'
,
'text'
);
$table
->
addColumn
(
'foo'
,
'text'
)
->
setPlatformOption
(
'collation'
,
'utf8_swedish_ci'
);
$table
->
addColumn
(
'bar'
,
'text'
)
->
setPlatformOption
(
'collation'
,
'utf8_general_ci'
);
$this
->
schemaManager
->
dropAndCreateTable
(
$table
);
$columns
=
$this
->
schemaManager
->
listTableColumns
(
'test_collation'
);
self
::
assertArrayNotHasKey
(
'collation'
,
$columns
[
'id'
]
->
getPlatformOptions
());
self
::
assertEquals
(
'utf8_unicode_ci'
,
$columns
[
'text'
]
->
getPlatformOption
(
'collation'
));
self
::
assertEquals
(
'utf8_swedish_ci'
,
$columns
[
'foo'
]
->
getPlatformOption
(
'collation'
));
self
::
assertEquals
(
'utf8_general_ci'
,
$columns
[
'bar'
]
->
getPlatformOption
(
'collation'
));
}
}
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