DuckDB 2 · From Python

Pass parameters safely

Use placeholders instead of building SQL from strings.

con.execute("SELECT * FROM events WHERE id = ?", [7]).fetchall()

Official DuckDB 2 documentation

More from python commands

All from python commands · DuckDB 2 cheatsheet

Was this page helpful?