Page MenuHomePhabricator

Reduce the amount of boilerplate that implementing FerretInterface requires

Authored by epriestley on Sep 7 2017, 6:20 PM.
Referenced Files
F12173040: D18559.diff
Fri, Sep 8, 9:28 PM
F12168002: D18559.diff
Thu, Sep 7, 3:52 AM
F12158007: D18559.id44566.diff
Tue, Sep 5, 10:51 AM
F12133873: D18559.diff
Aug 25 2023, 2:01 AM
F12129301: D18559.diff
Aug 21 2023, 12:12 PM
Unknown Object (File)
Jul 25 2023, 1:29 AM
Unknown Object (File)
Jul 18 2023, 1:44 PM
Unknown Object (File)
Jul 14 2023, 8:24 AM



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