Page MenuHomePhabricator

Use expression builder instead of raw SQL in Wikibase
Closed, ResolvedPublic

Description

Now that T210206: Deprecate raw SQL conditions for IDatabase methods (select, insert, etc.) is done, this extension should migrate away from building and passing around raw SQL to expression builders.

It improves readability and security of the code and is more aligned with industry practices easing onboarding.

For more information check T210206 and T350075.

Calls to Database::addQuotes(), ::buildLike(), ::makeList() indicate that raw SQL is being built and passed around.

Event Timeline

ItamarWMDE moved this task from Incoming to Other Projects on the wmde-wikidata-tech board.

Tagging the Product platform team as this relates to general Wikibase. No particular urgency specified from the Wikidata side.

Change #1019776 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/extensions/Wikibase@master] Migrate buildLike, addQuotes, makeList to expression builder

https://gerrit.wikimedia.org/r/1019776

Change #1037457 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Wikibase@master] Use expression builder to build where conditions

https://gerrit.wikimedia.org/r/1037457

Change #1037457 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use expression builder to build where conditions

https://gerrit.wikimedia.org/r/1037457

Change #1019776 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Migrate buildLike to expression builder

https://gerrit.wikimedia.org/r/1019776

Change #1055594 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Wikibase@master] Use expression builder to avoid IDatabase::makeList

https://gerrit.wikimedia.org/r/1055594

Change #1055594 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Use expression builder instead of raw sql

https://gerrit.wikimedia.org/r/1055594