DuckDB 2 · From Python

Use a database file

Connect to a file so tables persist between runs.

con = duckdb.connect("analytics.duckdb")
con.execute("CREATE TABLE IF NOT EXISTS events (id INTEGER, name VARCHAR)")

Official DuckDB 2 documentation

More from python commands

All from python commands · DuckDB 2 cheatsheet

Was this page helpful?