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
F18091461: D15673.diff
Wed, Aug 6, 9:44 PM
F17949391: D15673.id.diff
Jul 31 2025, 11:21 PM
F17919128: D15673.diff
Jul 30 2025, 2:07 AM
F17781633: D15673.diff
Jul 24 2025, 6:46 AM
F17625417: D15673.diff
Jul 10 2025, 3:15 AM
Unknown Object (File)
May 27 2025, 11:01 AM
Unknown Object (File)
Apr 24 2025, 9:36 AM
Unknown Object (File)
Apr 23 2025, 6:52 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
Branch
readonly10
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11634
Build 14555: Run Core Tests
Build 14554: arc lint + arc unit

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.