Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63e2d7e

Browse files
committed
Merge pull request symfony#2196 from Sgoettschkes/issue1638
Adding a note describing the configuration of SQLite with doctrine
2 parents 78c59d0 + 73dd7e0 commit 63e2d7e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

book/doctrine.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,44 @@ for you:
111111
[mysqld]
112112
collation-server = utf8_general_ci
113113
character-set-server = utf8
114+
115+
.. note::
116+
117+
If you want to use SQLite as your database, you need to set the path
118+
where your database file should be stored:
119+
120+
.. configuration-block::
121+
122+
.. code-block:: yaml
123+
124+
# app/config/config.yml
125+
doctrine:
126+
dbal:
127+
driver: pdo_sqlite
128+
path: "%kernel.root_dir%/sqlite.db"
129+
charset: UTF8
130+
131+
.. code-block:: xml
132+
133+
<!-- app/config/config.xml -->
134+
<doctrine:config
135+
driver="pdo_sqlite"
136+
path="%kernel.root_dir%/sqlite.db"
137+
charset="UTF-8"
138+
>
139+
<!-- ... -->
140+
</doctrine:config>
141+
142+
.. code-block:: php
143+
144+
// app/config/config.php
145+
$container->loadFromExtension('doctrine', array(
146+
'dbal' => array(
147+
'driver' => 'pdo_sqlite',
148+
'path' => '%kernel.root_dir%/sqlite.db',
149+
'charset' => 'UTF-8',
150+
),
151+
));
114152
115153
Creating an Entity Class
116154
~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)