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
F14021306: D15673.diff
Wed, Nov 6, 7:04 AM
F14017452: D15673.id37772.diff
Mon, Nov 4, 5:14 PM
F14002364: D15673.diff
Fri, Oct 25, 6:18 PM
F13996976: D15673.id.diff
Thu, Oct 24, 1:30 AM
Unknown Object (File)
Thu, Oct 10, 2:46 AM
Unknown Object (File)
Oct 7 2024, 1:43 AM
Unknown Object (File)
Oct 7 2024, 1:43 AM
Unknown Object (File)
Oct 7 2024, 1:43 AM
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.