You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use this library in a project where I was previously using Doctrine's DBAL with an SQLite database. When I attempt to write to the database I get:
SQLSTATE[HY000]: General error: 8 attempt to write a readonly database
I was able to read from and write to it just fine previously, so I did some digging.
When creating my own Doctrine Connection, I must use the following code (with an actual path):
DriverManager::getConnection([
'path' => /path/to/database,
'driver' => 'pdo_sqlite'
]);
...while the SQL repository creates it via:
DriverManager::getConnection(['pdo' => $pdo])
It seems SQLite requires it to be done a bit differently.
Perhaps it would be best to allow the user to inject their own DBAL connection?
The text was updated successfully, but these errors were encountered:
I'm trying to use this library in a project where I was previously using Doctrine's DBAL with an SQLite database. When I attempt to write to the database I get:
I was able to read from and write to it just fine previously, so I did some digging.
When creating my own Doctrine Connection, I must use the following code (with an actual path):
DriverManager::getConnection([
'path' => /path/to/database,
'driver' => 'pdo_sqlite'
]);
...while the SQL repository creates it via:
DriverManager::getConnection(['pdo' => $pdo])
It seems SQLite requires it to be done a bit differently.
Perhaps it would be best to allow the user to inject their own DBAL connection?
The text was updated successfully, but these errors were encountered: