Skip to content

Adding a note describing the configuration of SQLite with doctrine #2196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 11, 2013
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,42 @@ for you:
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8

.. note::

If you want to use SQLite as your database, you need to set the path
where your database file should be stored:

.. code-block:: yaml

# app/config/config.yml
doctrine:
dbal:
driver: pdo_sqlite
path: "%kernel.root_dir%/sqlite.db"
charset: UTF8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also add a XML and PHP example:

<!-- app/config/config.xml -->
<doctrine:config
    driver="pdo_sqlite"
    path="%kernel.root_dir%/sqlite.db"
    charset="UTF-8"
>
    <!-- ... -->
</doctrine:config>
// app/config/config.php
$container->loadFromExtension('doctrine', array(
    'dbal' => array(
        'driver'  => 'pdo_sqlite',
        'path'    => '%kernel.root_dir%/sqlite.db',
        'charset' => 'UTF-8',
    ),
));


.. code-block:: xml

<!-- app/config/config.xml -->
<doctrine:config
driver="pdo_sqlite"
path="%kernel.root_dir%/sqlite.db"
charset="UTF-8"
>
<!-- ... -->
</doctrine:config>

.. code-block:: php

// app/config/config.php
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_sqlite',
'path' => '%kernel.root_dir%/sqlite.db',
'charset' => 'UTF-8',
),
));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should put the code blocks in a configuration block:

.. configuration-block::

    .. code-block:: yml

        # ...

     .. code-block:: xml

        <!-- ... -->

    .. code-block:: php

        // ...


Creating an Entity Class
~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down