Given:
letters = list("abc")
I'd like to get all rows in characters
that contain any of the letters in letters
in their c
column. I can do this, but only with python's string operations, which isn't suitable given it's vulnerabilities.
Ideally (my example is simplified) this would be using the GLOB clause.
E.g.
>>> cur.execute(**the statement here**)
>>> print(cur.fetchall())
>>> [('a',), ('b',), ('c',)]
Creation of the db:
import sqlite3
import string
def char_generator():
for c in string.ascii_lowercase:
yield (c,)
con = sqlite3.connect(":memory:")
cur = con.cursor()
cur.execute("create table characters(c)")
cur.executemany("insert into characters(c) values (?)", char_generator())