def METHOD_NAME(library_no_commit, should_fail, no_trans, orders_nr):
    sql_data = (RESOURCES_DIR / "script.sql").read_text()
    if should_fail:
        sql_data += "\nINVALID STATEMENT;"
        effect = pytest.raises(sqlite3.OperationalError)
    else:
        effect = nullcontext()
    with temp_filename(content=sql_data, suffix=".sql", mode="w") as sql_script:
        with effect:
            library_no_commit.execute_sql_script(sql_script, sanstran=no_trans)
    if no_trans:
        # Commit what was executed from the script. (even partially when it errors)
        # This way we guarantee the rollback functionality during a script execution
        #  that threw an error.
        library_no_commit.query("COMMIT;")
    orders = library_no_commit.query("SELECT * FROM orders")
    assert len(orders) == orders_nr