Page MenuHomePhabricator

Provide a way to explicitly establish a database connection

Authored by epriestley on Apr 10 2016, 12:37 PM.
Referenced Files
Unknown Object (File)
Fri, Aug 12, 4:19 PM
Unknown Object (File)
Sat, Aug 6, 4:16 PM
Unknown Object (File)
Fri, Aug 5, 7:52 AM
Unknown Object (File)
Wed, Aug 3, 7:10 AM
Unknown Object (File)
Sun, Jul 24, 6:43 AM
Unknown Object (File)
Sat, Jul 23, 4:26 AM
Unknown Object (File)
Tue, Jul 19, 10:24 AM
Unknown Object (File)
Jul 6 2022, 9:34 AM



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

rPHU libphutil
Lint Not Applicable
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.