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
Unknown Object (File)
Wed, Jan 22, 7:54 AM
Unknown Object (File)
Tue, Jan 21, 3:43 PM
Unknown Object (File)
Tue, Jan 21, 12:45 PM
Unknown Object (File)
Thu, Jan 16, 7:47 AM
Unknown Object (File)
Tue, Dec 31, 11:07 PM
Unknown Object (File)
Dec 29 2024, 10:24 PM
Unknown Object (File)
Dec 28 2024, 2:41 PM
Unknown Object (File)
Dec 27 2024, 12:37 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable