def simple_expression(joiner='<STR_LIT:U+002CU+0020>', **fields):
expression, params = [], {}<EOL>for field_name, value in sorted(fields.items(), key=lambda kv: kv[<NUM_LIT:0>]):<EOL><INDENT>key = '<STR_LIT>' % field_name<EOL>expression.append('<STR_LIT>' % (field_name, key))<EOL>params[key] = value<EOL><DEDENT>return joiner.join(expression), params<EOL>
Build a simple expression ready to be added onto another query.

    >>> simple_expression(joiner=' AND ', name='bob', role='admin')
    "`name`=%(_QB_name)s AND `name`=%(_QB_role)s", { '_QB_name': 'bob', '_QB_role': 'admin' }