9/12 push db validation up to Naming_table
commitcbc6cbc39a4564d7676e3e2e9021c23dc3357737
authorLucian Wischik <ljw@fb.com>
Fri, 24 Apr 2020 05:39:37 +0000 (23 22:39 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Apr 2020 21:16:54 +0000 (30 14:16 -0700)
treed3b90cbebd17be34f33baabe97004393c66e657e
parent6e3f41e82d6985f8a744b5874c21ec2f3dcb0dec
9/12 push db validation up to Naming_table

Summary:
This diff stack gets rid of global sharedmem state "NamingTableDatabaseSettings", which stores the path to the naming DB.

The function `Naming_sqlite.set_db_path` is bad because a leaf function like this shouldn't be setting such globally important state as db_path. Therefore my goal is to move "set_db_path" higher up the callstack. To achieve this, I first have to clean up set_db_path, to make it a pure function that only sets the db_path, and move its side effects into its callers. That's what this diff does.

Reviewed By: arxanas

Differential Revision: D21192324

fbshipit-source-id: 3f4c72a12cef3e52f0ec09bdf6dafab13c6b327a
hphp/hack/src/naming/naming_sqlite.ml
hphp/hack/src/naming/naming_sqlite.mli
hphp/hack/src/naming/naming_table.ml