-
Notifications
You must be signed in to change notification settings - Fork 86
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
SQLAlchemyBackend postgresql initialize error #64
Comments
It's the "USE" statement (line 148, in sqlalchemy_backend.py). Postgres always connects to a database using the connect string, so the USE is not needed. A possible fix would be to change the "if" statement that checks for ":memory:" to check to see if it is postgres as well. |
To implement this properly, it should be broken out into its own class instead of the inline postgres-specific code, but for those that need it, this is my Postgres workaround. I wrote some unit tests, and it seems to work for Postgresql. As a warning, I did NOT test this thoroughly with other database types to make sure I didn't break anything.
|
Whipped up some commits based on the above, let me know what you think: astubbs@ee6da49 |
The tests don't seem to be self contained in tox. What's the process for getting this tested properly? |
Ignore that sha, the branch is here: https://github.com/astubbs/bottle-cork/tree/postgres-fix |
I didn't test it, but your branch doesn't look quite right. You are calling create_engine twice for postgresql and not setting the isolation level back. It looks like a copy-paste mistake. |
No, I added it on purpose. How can you create the database, and connect to it - I understood you have to connect directly to the db, so you'd need to reconnect, no? commits: https://github.com/astubbs/bottle-cork/commits/postgres-fix |
I see what you did now, sorry about that. As far as the tests, I'm not sure. As you can guess since I posted this a while ago, I didn't get around to actually implementing it and figuring out the tests. Maybe Federico can help with some direction on running the tests. |
Hi. I wanted to know what is the status of this issue? Was it fixed/merged? I see there is some fix on it. Thx. |
For db_full_url like 'postgresql://user:password@localhost/database', initialization will fail.
The text was updated successfully, but these errors were encountered: