Skip to content
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

Not working with SQLite? #20

Open
geekish opened this issue Oct 21, 2016 · 1 comment
Open

Not working with SQLite? #20

geekish opened this issue Oct 21, 2016 · 1 comment

Comments

@geekish
Copy link

geekish commented Oct 21, 2016

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?

@geekish
Copy link
Author

geekish commented Oct 21, 2016

Never mind, getting the same error now whether I use my own DBAL connection or not.

I still would like to be able to inject an instance of Connection into SqlRepository instead of PDO, for when I get this working. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant