def _quote_escape(item):

    rex_sqlquote = re.compile("'", re.M)

    return rex_sqlquote.sub("''", item)
Make sure single quotes are escaped properly in sqlite3 fashion.
dataset/ETHPy150Open saltstack/salt/salt/queues/sqlite_queue.py/_quote_escape