<ul>
<li>Use PropertyInfoDataTypeLookup</li>
<ul>
<li>Either separate SqlStore::newPropertyInfoLookup() from store (at a glance doesn’t look that hard); by separate we mean move the instantiation code out of SqlStore and DirectSqlStore and into client and repo service wiring</li>
<li>If the above turns out to be challenging, copy the instantiation code and make sure the same (!) cache is used</li>
</ul>
<li>Consider using InProcessCachingDataTypeLookup (quick lookups of the same property) unless that’s already built into the caching property info lookup</li>
How to check that it works correctly? The situation where things may go wrong is when creating a new property and using it right after to create a statement afterwards. This is due the data type lookup relying on the property info table (secondary data) which doesn’t get written to immediately, but in a deferred update. Note that depending on the solution chosen for T359421 this may only be problematic for some kinds of properties (none for now, and all wikibase-entityid ones once the new value-parser field is actually used for entity schema)
Test manually?
Plug into poc patch and see what falls over?
Wait until T359421 is done, plug it in, and see what falls over?