Page MenuHomePhabricator

NameTableStoreFactory should be extensible
Open, Needs TriagePublic

Description

NameTableStore solves the common problem of normalizing database tables to replace strings (user-friendly, easy to avoid conflicts) with numeric IDs (more performant, reduces storage space requirements). This is widely needed in extensions and alternative solutions are worse (see T119173: RFC: Discourage use of MySQL's ENUM type), but NameTableStoreFactory hardcodes some core tables and is unusuable for anything else; and direct instantiation has been "outlawed" by the new stable interface policy (which also creates a maintenance problem for the three extensions already using NameTableStore: Wikibase, MachineVision and WikimediaEditorTasks, since NameTableStore can now be changed without deprecation).

NameTableStoreFactory should adopt a configuration variable or some other extension mechanism for adding new tables.

(See also: T216468: Document NameTableStore)