Page MenuHomePhabricator

Replace TranslationStatsInterface::preQuery with a SelectQueryBuilder
Open, MediumPublic


In Translate extension the TranslationStatsInterface::preQuery takes all arguments as IReadableDatabase::select.
The best replacement for the IReadableDatabase::select would be SelectQueryBuilder from the TranslationStats provider as suggested in code review at


interface TranslationStatsInterface {
	// [...]
	// old:
	public function preQuery(
		IDatabase $database,
	// new:
	public function newSelectQueryBuilder( IReadableDatabase $dbr, string &$type, string $start, ?string $end ): SelectQueryBuilder;
	// [...]

Maybe omit $start/$end from the function and create a new function (getTimestampColumn) to get the name of the relevant column and add the condition before execution.