From Python's documentation (https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute), I should be able to execute SQL statements using parameterized placeholders. Yet, the code below doesn't work.
import sqlite3
conn = sqlite3.connect("temp.db")
c = conn.cursor()
c.execute("create table ? (foo text, bar text)", ("table_name",))
conn.commit()
conn.close()
I'm getting an error:
Traceback (most recent call last):
File "main.py", line 6, in <module>
c.execute("create table ? (foo text, bar text)", ("table_name",))
sqlite3.OperationalError: near "?": syntax error
But if I switch out of using parameterized placeholders, it works.