cldellow / datasette-parquet

Add DuckDB, Parquet, CSV and JSON lines support to Datasette
Apache License 2.0
47 stars 7 forks source link

support query runtime limits #6

Open cldellow opened 1 year ago

cldellow commented 1 year ago

SQLite's Python interface supports interrupting long-running queries. DuckDB's C API supports this, too, but it has not yet been exposed to the Python API. See https://github.com/duckdb/duckdb/issues/5938 and https://github.com/duckdb/duckdb/pull/3749

A really brutal workaround: DuckDB will respond to signals... could we temporarily install a signal handler that prevents SIGINT from killing the server, but lets it percolate through to DuckDB to interrupt? That feels fragile and complex, might be easier to learn how to patch DuckDB

curiousleo commented 9 months ago

interrupt() is now supported in DuckDB's Python API: https://github.com/duckdb/duckdb/pull/7895. This change was released in version 0.9.0: https://github.com/duckdb/duckdb/releases/tag/v0.9.0