Create naming_local_changes table in Rust naming table builder
commit76867501a790dbd6458b97092f1f34374af291a2
authorJake Bailey <jakebailey@meta.com>
Tue, 18 Oct 2022 19:33:56 +0000 (18 12:33 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Oct 2022 19:33:56 +0000 (18 12:33 -0700)
tree453f737e3f2158a6d7c1fbe2ce1feb8e02a15bc4
parent1f280df4fce3d5e9ea9df2aa9bfe508586dee9b9
Create naming_local_changes table in Rust naming table builder

Summary:
hh_server and hh_single_type_check will read the single value from this table when loading a saved state. It contains the naming table delta from a previously-loaded saved state, as an OCaml-marshaled blob. Since we are building the table from scratch in the naming table builder (and our Rust never attempts to save a naming table with a delta), the delta will always be empty. Create the table and write an empty delta upon creation.

The local changes table also contains a BASE_CONTENT_VERSION column. This column needs only be unique, as per this comment from [naming_table.ml](https://www.internalfb.com/code/fbsource/[a9b2544fea81]/fbcode/hphp/hack/src/naming/naming_table.ml?lines=406):

```
    (* Ideally, we would have a commit hash, which would result in the same
       content version given the same version of source files. However,
       using a unique version every time we save the naming table from scratch
       is good enough to enable us to check that the local changes diff
       provided as an argument to load_from_sqlite_with_changes_since_baseline
       is compatible with the underlying SQLite table. *)
```

Reviewed By: shayne-fletcher

Differential Revision: D40479834

fbshipit-source-id: 7f6cac170d4503ae5be3958e261c58e3e393206d
hphp/hack/src/Cargo.lock
hphp/hack/src/naming/names_rust/Cargo.toml
hphp/hack/src/naming/names_rust/naming_sqlite.rs