def METHOD_NAME(upsert_stmt, compiler, **kwargs):
    # See https://sqlite.org/lang_insert.html
    insert_stmt = upsert_stmt.table.insert().prefix_with("OR REPLACE")
    return compiler.process(insert_stmt)