Page MenuHomePhabricator

Provide a way to explicitly establish a database connection
ClosedPublic

Authored by epriestley on Apr 10 2016, 12:37 PM.
Tags
None
Referenced Files
F13040056: D15673.diff
Tue, Apr 16, 11:55 AM
Unknown Object (File)
Thu, Apr 11, 11:47 AM
Unknown Object (File)
Mon, Apr 8, 1:01 PM
Unknown Object (File)
Sun, Apr 7, 9:37 AM
Unknown Object (File)
Sat, Apr 6, 8:03 PM
Unknown Object (File)
Wed, Mar 27, 6:51 PM
Unknown Object (File)
Wed, Mar 27, 6:04 PM
Unknown Object (File)
Wed, Mar 27, 5:56 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Provide a way to explicitly establish a database connection.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.

revisions that have longer explanations than code always worry me

This revision is now accepted and ready to land.Apr 10 2016, 3:57 PM
This revision was automatically updated to reflect the committed changes.