Reputation: 50547
I'm trying to automatically create a test database before running my tests without shelling out, but I'm struggling to connect to the postgres server without connecting to a database.
If I give create_engine()
a URL
with .database
None
it tries to connect to a default database name.
Is what I'm trying to do possible?
I was going a long the lines of this answer: https://stackoverflow.com/a/28784334/311220
Upvotes: 3
Views: 1043
Reputation: 50547
One way to achieve this is to connect to the default postgres
database which should always be present. Then once connected you can create the desired databases.
Upvotes: 2