Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwills/buenavista
A Postgres Proxy Server in Python
https://github.com/jwills/buenavista
Last synced: about 2 months ago
JSON representation
A Postgres Proxy Server in Python
- Host: GitHub
- URL: https://github.com/jwills/buenavista
- Owner: jwills
- License: apache-2.0
- Created: 2022-11-28T05:51:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T18:27:33.000Z (8 months ago)
- Last Synced: 2024-07-13T02:15:21.599Z (2 months ago)
- Language: Python
- Size: 2 MB
- Stars: 201
- Watchers: 10
- Forks: 20
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Buena Vista: A Programmable Postgres Proxy Server
Buena Vista is a Python library that provides a [socketserver](https://docs.python.org/3/library/socketserver.html)-based implementation
of the [Postgres wire protocol (PDF)](https://beta.pgcon.org/2014/schedule/attachments/330_postgres-for-the-wire.pdf).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](https://github.com/jwills/dbt-duckdb): when a long-running Python process
is operating on a [DuckDB](http://duckdb.org) database, you cannot connect to the DuckDB file using the CLI or
with a database query tool like [DBeaver](https://dbeaver.io/) 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:```sh
pip3 install buenavista
python3 -m buenavista.examples.duckdb_postgres
```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.