Page MenuHomePhabricator

Reduce the amount of boilerplate that implementing FerretInterface requires
ClosedPublic

Authored by epriestley on Sep 7 2017, 6:20 PM.
Tags
None
Referenced Files
F14010046: D18559.diff
Thu, Oct 31, 3:33 AM
F13985936: D18559.diff
Sun, Oct 20, 11:40 PM
F13980962: D18559.diff
Sat, Oct 19, 1:34 PM
F13980961: D18559.diff
Sat, Oct 19, 1:34 PM
F13977349: D18559.id.diff
Fri, Oct 18, 6:13 PM
Unknown Object (File)
Sep 26 2024, 5:37 PM
Unknown Object (File)
Sep 23 2024, 3:35 PM
Unknown Object (File)
Sep 13 2024, 3:59 AM
Subscribers
None

Details

Summary

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

Repository
rP Phabricator
Branch
ferret11
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 18349
Build 24704: Run Core Tests
Build 24703: arc lint + arc unit