How to use sqlite database on symfony2 project?

前端 未结 5 1241
温柔的废话
温柔的废话 2020-12-29 05:14

In a Symfony2 project, you can configure the databases connections at the app/config/parameters.ini file. Documentation states that you can use, among others, sqlite3 PDO dr

5条回答
  •  萌比男神i
    2020-12-29 05:47

    According to Doctrine the elements used for sqlite DBAL configuration are:

    • user (string): Username to use when connecting to the database.
    • password (string): Password to use when connecting to the database.
    • path (string): The filesystem path to the database file. Mutually exclusive with memory. path takes precedence.
    • memory (boolean): True if the SQLite database should be in-memory (non-persistent). Mutually exclusive with path. path takes precedence.

    This is also listed in the full reference for Doctrine configuration in Symfony2, although not elaborated on.

    So you need to switch up your config params to match whats appropriate for sqlite.

提交回复
热议问题