Homec4science

Provide a way to explicitly establish a database connection

Authored by epriestley <git@epriestley.com> on Apr 10 2016, 14:33.

Description

Provide a way to explicitly establish a database connection

Summary:
Ref T4571. Normally, we establish a connection lazily on the first query.

Sometimes, though, we only want to connect. Usually, we do this by running a trivial query like SELECT 1, which is fine, since all of these cases are currently in configuration/CLI/administration code and doing an extra query isn't a big deal.

One case where we do this is in bin/storage, to make sure your credentials and/or --user flag are authorized.

In cluster mode, I want to be able to explicitly establish connections to health-check databases, which is a little more latency-sensitive since it will run in-process during the course of normal requests. Instead of issuing a dummy query, provide a method to just connect explicitly.

Test Plan: See next revision.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4571

Differential Revision: https://secure.phabricator.com/D15673

Details

Committed
epriestley <git@epriestley.com>Apr 10 2016, 21:17
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUd22d1ec5e35c: Support "timeout" parameter in older MySQL connections
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUa46f7b7e5d80: Provide a way to explicitly establish a database connection (authored by epriestley <git@epriestley.com>).Apr 10 2016, 21:17