Page MenuHomePhabricator

Reduce the amount of boilerplate that implementing FerretInterface requires

Authored by epriestley on Sep 7 2017, 6:20 PM.
Referenced Files
F13261239: D18559.diff
Mon, May 27, 12:49 AM
F13247090: D18559.diff
Thu, May 23, 3:48 PM
F13243783: D18559.diff
Thu, May 23, 4:13 AM
F13236281: D18559.diff
Tue, May 21, 9:03 AM
F13229141: D18559.id44566.diff
Mon, May 20, 2:40 PM
F13225829: D18559.diff
Sun, May 19, 5:38 PM
F13178169: D18559.diff
Wed, May 8, 8:14 PM
Unknown Object (File)
Tue, May 7, 1:54 PM



See brief discussion in D18554. All the index tables are the same for every application (and, at this point, seem unlikely to change) and we never actually pass these objects around (they're only used internally).

In some other cases (like Transactions) not every application has the same tables (for example, Differential has extra field for inline comments), and/or we pass the objects around (lots of stuff uses $xactions directly).

However, in this case, and in Edges, we don't interact with any representation of the database state directly in much of the code, and it doesn't change from application to application.

Just automatically define document, field, and ngram tables for anything which implements FerretInterface. This makes the query and index logic a tiny bit messier but lets us delete a ton of boilerplate classes.

Test Plan

Indexed objects, searched for objects. Same results as before with much less code. Ran bin/storage upgrade, got a clean bill of health.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable