Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail hanami db drop when cannot check database existence #281

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

katafrakt
Copy link

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

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.
@katafrakt katafrakt changed the title Fail db drop when cannot check database existence Fail hanami db drop when cannot check database existence Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant