[DBAL-332] Memory option for Sqlite driver does nothing Created: 29/Aug/12 Updated: 17/Sep/12 Resolved: 17/Sep/12
|Affects Version/s:||2.2.2, 2.3|
|Reporter:||Damien ALEXANDRE||Assignee:||Benjamin Eberlei|
PHP Version 5.3.10
I'm trying to configure a "memory" sqlite database, as described here: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#pdo-sqlite
So here is my configuration (config_test.yml) :
I'm then running
and the result is a "myBdName" db file (the filename contains the quote!!) in my root folder.
I don't understand why the file http://www.doctrine-project.org/api/dbal/2.3/source-class-Doctrine.DBAL.Schema.SqliteSchemaManager.html#46 is creating a path option with my DB name, if I comment the line 57, everything seems fine (no more file created).
I have seen some memory related options in the Doctrine test suite so maybe I'm doing it wrong, and in that case that's a documentation issue I can work on.
|Comment by Benjamin Eberlei [ 05/Sep/12 ]|
You cannot create an in memory database using Symfonys database:create. The in memory database will be closed when the request ends. So its completly useless this way. You have to recreate it in every request that you want to use it. It is just good for one request.
|Comment by Damien ALEXANDRE [ 06/Sep/12 ]|
My example with "app/console" is misleading,
The issue here is that there is an option documented (first link) that doesn't work / is not implemented (second link). And a physic file is generated, it should not.
As your answer seems to be based on the mistaken impression that I wanted to use volatile database in a persistent way, I'm reopening this issue.
Thanks for your time.
|Comment by Benjamin Eberlei [ 07/Sep/12 ]|
Try removing the user/password keys. memory database connection works for me, this seems to be a configuration issue.
If you want to create an in memory db for testing then you have to create the schema with SchemaTool inside the phpunit tests.
|Comment by Benjamin Eberlei [ 17/Sep/12 ]|
No feedback on potential fix, this issue is either misconfiguration or wrong use of the API. I couldn't reproduce this and it works for me (TM).