@@ -60,6 +60,9 @@ Full Default Configuration
60
60
driver : pdo_mysql
61
61
platform_service : ~
62
62
63
+ # the version of your database engine
64
+ server_version : ~
65
+
63
66
# when true, queries are logged to a "doctrine" monolog channel
64
67
logging : " %kernel.debug%"
65
68
profiling : " %kernel.debug%"
@@ -102,6 +105,9 @@ Full Default Configuration
102
105
# True to use a pooled server with the oci8 driver
103
106
pooled : ~
104
107
108
+ # the version of your database engine
109
+ server_version : ~
110
+
105
111
# Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
106
112
MultipleActiveResultSets : ~
107
113
@@ -202,6 +208,7 @@ Full Default Configuration
202
208
charset =" UTF8"
203
209
logging =" %kernel.debug%"
204
210
platform-service =" MyOwnDatabasePlatformService"
211
+ server-version =" 5.6"
205
212
>
206
213
<doctrine : option key =" foo" >bar</doctrine : option >
207
214
<doctrine : mapping-type name =" enum" >string</doctrine : mapping-type >
@@ -393,6 +400,7 @@ The following block shows all possible configuration keys:
393
400
charset : UTF8
394
401
logging : " %kernel.debug%"
395
402
platform_service : MyOwnDatabasePlatformService
403
+ server_version : 5.6
396
404
mapping_types :
397
405
enum : string
398
406
types :
@@ -428,7 +436,8 @@ The following block shows all possible configuration keys:
428
436
wrapper-class =" MyDoctrineDbalConnectionWrapper"
429
437
charset =" UTF8"
430
438
logging =" %kernel.debug%"
431
- platform-service =" MyOwnDatabasePlatformService" >
439
+ platform-service =" MyOwnDatabasePlatformService"
440
+ server-version =" 5.6" >
432
441
433
442
<doctrine : option key =" foo" >bar</doctrine : option >
434
443
<doctrine : mapping-type name =" enum" >string</doctrine : mapping-type >
@@ -437,6 +446,17 @@ The following block shows all possible configuration keys:
437
446
</doctrine : config >
438
447
</container >
439
448
449
+ .. note ::
450
+
451
+ The ``server_version `` option was added in Doctrine DBAL 2.5, which is used
452
+ by DoctrineBundle 1.3 version. The value of this option should match your
453
+ database server version (use ``postgres -V `` or ``psql -V `` command to find
454
+ your PostgreSQL version and ``mysql -V `` to get your MySQL version).
455
+
456
+ If you don't define this option and you don't have created your database yet,
457
+ you may get ``PDOException `` errors because Doctrine will try to guess the
458
+ database server version automatically and none is available.
459
+
440
460
If you want to configure multiple connections in YAML, put them under the
441
461
``connections `` key and give them a unique name:
442
462
@@ -451,11 +471,13 @@ If you want to configure multiple connections in YAML, put them under the
451
471
user : root
452
472
password : null
453
473
host : localhost
474
+ server_version : 5.6
454
475
customer :
455
476
dbname : customer
456
477
user : root
457
478
password : null
458
479
host : localhost
480
+ server_version : 5.7
459
481
460
482
The ``database_connection `` service always refers to the *default * connection,
461
483
which is the first one defined or the one configured via the
0 commit comments