You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documented support for named paramstyle in sqlite3.
The documentation for `sqlite3.paramstyle` states that only `qmark` and
`numeric` styles are supported for parameter placeholders but, according
to the SQLite documentation, the `named` style is also supported.
See the following links for more details:
- https://docs.python.org/3/library/sqlite3.html#sqlite3.paramstyle
- https://peps.python.org/pep-0249/#paramstyle
- https://www.sqlite.org/lang_expr.html#parameters
A simple example confirms that this is supported:
```pycon
>>> import sqlite3
>>> con = sqlite3.connect(":memory:")
>>> cur = con.execute("CREATE TEMPORARY TABLE t (name TEXT)")
>>> cur.execute("INSERT INTO t (name) VALUES ('Bob'), ('Cat'), ('Joe')")
<sqlite3.Cursor object at 0x7fcbe373b940>
>>> cur.execute("SELECT * FROM t WHERE name = :name", {"name": "Cat"})
<sqlite3.Cursor object at 0x7fcbe373b940>
>>> print(cur.fetchone()[0])
Cat
```
0 commit comments