Currently, the NameTableStore class can only be used for three MediaWiki core tables: change_tag_def, content_models, and slot_roles. It would be nice to be able to use it for some extension tables as well (in fact, Wikibase already uses it for the wbt_type table), but this currently isn’t possible in a way that’s covered by the stable interface policy: neither NameTableStore nor NameTableStoreFactory are marked as @newable, and while the NameTableStoreFactory is available as a service in MediaWikiServices, it only supports creating stores for these three hard-coded tables (see its getTableInfo() method).
Description
Related Objects
Event Timeline
@BPirkle Sounds like we would need to make the changes here (as I see it in your tracking/watching column)?
If so I'll move it to an appropriate column on our boards :)
NameTableStore can become newable. The fact that it 's not is just an oversight from my point of view. I'd be reluctant to make it stable to extend, though.
NameTableStoreFactory is conceptually questionable - different NameTableStore instances may be used for totally different things, so NameTableStoreFactory is bound to cross domain boundaries. The way it's currently used it's really bound to the revision storage backend. Perhaps the could be a base class or a trait or a helper that would make it easy to implement separate factories for different use cases of NameTableStore.
@tstarling rememberd that we were discussing this exact thing when he worked on NameTabelStoreFactory: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/455487/4
I think his suggestion at the time was to gave a newFromSpec() method that would take an array like the ones we define in self::$info.