cli
cli copied to clipboard
Fail `hanami db drop` when cannot check database existence
Currently if the existence check for a database fails (for example due to whole database server being down or user not existing), Hanami CLI will anyway return information that the database was dropped.
This changes it to failing with an explicit error message in such case. Examples:
$ hanami db drop
Could not check if the database exists. Error message:
psql: error: connection to server at "localhost" (::1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
$ hanami db drop
Could not check if the database exists. Error message:
psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: database "katafrakt" does not exist
Addresses #275