In your examples you’re creating a database config and then doing this:
let database = PostgreSQLDatabase(config: databaseConfig)
databases.add(database: database, as: .psql)
services.register(databases)
I realized that in my project I wasn’t creating the database, and I’m just calling services.register right against the databaseConfig itself and it seems to work fine.
So if you are only specifying a config and not the database I’d be surprised if it works since it won’t know how to map the .psql DB used by models to a specific database.
The main reason for specifying it explicitly is because Fluent can work with multiple databases so you need to set them up correctly to work with the different models.