First off, this crate is great and exactly what we needed for our tests. Definitely happy to help maintain it going forward, or maybe to help merge it with the main sqlx codebase.
So for the issue: if the username is not postgres (I think quite common in some managed DB cloud offerings), then this will use the username as the database on which CREATE DATABASE is called. Many times, this database will not exist.
It seems that more consistent solution would be to just use postgres as the default CREATE DATABASE context, and then maybe have the option of using something else if an environment variable, e.g. DEFAULT_DATABASE_NAME, is supplied.
I've created a fork with this change. What do you think?
First off, this crate is great and exactly what we needed for our tests. Definitely happy to help maintain it going forward, or maybe to help merge it with the main sqlx codebase.
So for the issue: if the username is not postgres (I think quite common in some managed DB cloud offerings), then this will use the username as the database on which CREATE DATABASE is called. Many times, this database will not exist.
It seems that more consistent solution would be to just use postgres as the default CREATE DATABASE context, and then maybe have the option of using something else if an environment variable, e.g. DEFAULT_DATABASE_NAME, is supplied.
I've created a fork with this change. What do you think?