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

is it a best practice to call `establish_connection` for every request? #555

Closed
rbalicki2 opened this Issue Dec 28, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@rbalicki2
Contributor

rbalicki2 commented Dec 28, 2016

Happy to take this to an IRC channel/slack group, but couldn't find one. Not sure if rust-beginners is appropriate, either.

I'm writing a web app using diesel and rocket, and in every route handler I'm calling establish_connection (straight from the getting started guide). Is this unnecessary overhead? Should I store a single connection to a database somewhere, and reuse that one?

@killercup

This comment has been minimized.

Member

killercup commented Dec 28, 2016

@rbalicki2

This comment has been minimized.

Contributor

rbalicki2 commented Dec 28, 2016

thank you!

@rbalicki2 rbalicki2 closed this Dec 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment