I started working on this project in order to address a common issue that people had when they were using another one of my Python projects, dbt-duckd

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-10-29 15:00:04

I started working on this project in order to address a common issue that people had when they were using another one of my Python projects, dbt-duckdb: when a long-running Python process is operating on a DuckDB database, you cannot connect to the DuckDB file using the CLI or with a database query tool like DBeaver to examine the state of the database, because each DuckDB file may only be open by a single process at a time. The Buena Vista library makes it possible to work with a DuckDB database from multiple different processes over the Postgres wire protocol, and the library makes it simple enough to run an example that illustrates the idea locally:

in order to start a Postgres server on localhost:5433 backed by the DuckDB database file that you passed in at the command line (or by an in-memory DuckDB database if you do not specify an argument.) You should be able to query the database via psql in another window by running psql -h localhost -p 5433 (no database/username/password arguments required) or by using the DBeaver Postgres client connection.

By default, SQLMesh config will be pulled from ./sqlmesh, a sample SQLMesh project with some basic (contrived) metric definitions.

Leave a Comment