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
F14438644: D15673.diff
Thu, Dec 26, 2:57 AM
Unknown Object (File)
Mon, Dec 23, 8:55 PM
Unknown Object (File)
Wed, Dec 18, 6:20 AM
Unknown Object (File)
Fri, Dec 13, 8:38 PM
Unknown Object (File)
Wed, Dec 11, 4:36 AM
Unknown Object (File)
Wed, Dec 11, 4:22 AM
Unknown Object (File)
Fri, Dec 6, 5:32 AM
Unknown Object (File)
Nov 25 2024, 11:35 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.