Page MenuHomePhabricator

Use expression builder instead of raw SQL in LoginNotify
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.

Details

Related Changes in Gerrit:

Event Timeline

Change 1003911 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/LoginNotify@master] Use Database::expr()

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

Change 1003911 merged by jenkins-bot:

[mediawiki/extensions/LoginNotify@master] Use Database::expr()

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

dom_walden subscribed.

I compared the SQL query that was run for the purgeSeen function before and after this change. It appeared identical.

I didn't know how to trigger the other queries.

Test environment: local docker LoginNotify 0.1 (c54cea3) 22:49, 17 February 2024.

MusikAnimal assigned this task to tstarling.