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

Check for a connection before running db.create task #397

Merged
merged 6 commits into from
Jun 25, 2020

Conversation

jwoertink
Copy link
Member

@jwoertink jwoertink commented Jun 22, 2020

Fixes #398

We currently have a db.verify_connection task, but this task only checks that you can connect to the database. When you run db.create, the database doesn't exist yet which means we have no way to check for the connection.

This update checks that you can connect to the postges engine before running the db.create. This allows us to catch the error and return a nicer error message to help users figure out what they need to do.

@jwoertink
Copy link
Member Author

🤨 maybe time to move Avram to Gh actions too...

@jwoertink
Copy link
Member Author

boom! Look at that. It kept failing on Travis, but passes on Gh Actions 🌮 🎉

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple small comments. LGTM when you're ready!

src/avram/tasks/db/create.cr Outdated Show resolved Hide resolved
src/avram/tasks/db/create.cr Outdated Show resolved Hide resolved
@jwoertink jwoertink merged commit af99911 into master Jun 25, 2020
@jwoertink jwoertink deleted the features/db.create branch June 25, 2020 15:43
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.

Unable to check connection before creating DB
3 participants