vapor / fluent-postgres-driver

🐘 PostgreSQL driver for Fluent.
MIT License
149 stars 53 forks source link

withPooledConnection throws "nil database identifier" #3

Closed alxstu closed 6 years ago

alxstu commented 6 years ago

Example:

return request.withPooledConnection(to: .psql, closure: { (db) -> Future<[User]> in
            return User.query(on: db).all()
    })

(or any other query on: db) throws "nil database identifier" in DatabaseConnection

Changing the Project to mysql works as expected.

tanner0101 commented 6 years ago

@alxstu try setting User.defaultDatabase = .psql.

Either way, we should have a better error message there.

alxstu commented 6 years ago

this: https://github.com/vapor/database-kit/commit/408b1d91e8abb7a96c6549ee4a9ef9520047a6b7 fixed the problem!