Skip to content

Add function to format an SQL tuple

Neil Shah-Quinn (WMF) requested to merge sql_tuple into main

Created by: nshahquinn

This is a useful convenience for analysts. For example, if you have a long list of users and you want to look up their user IDs, this lets you simply write:

wmf.mariadb.run(f"""
SELECT
    user_name,
    user_id
FROM user
WHERE
    user_name IN {sql_tuple(users)}
""", "enwiki")

Merge request reports