LLM-powered chat interface to your Postgres database - (psql powered with Natural Language)
Project description
psqlomni
Natural language chat for your SQL database.
psqlomni translates plain English into SQL and runs it against your database with approval.
It supports SQLAlchemy-compatible databases and multiple model providers:
- OpenAI
- Anthropic
- Google Gemini
- Ollama
Demo Video
Install
pip install psqlomni
Optional provider extras:
pip install "psqlomni[anthropic]"
pip install "psqlomni[google]"
pip install "psqlomni[ollama]"
pip install "psqlomni[all-models]"
Run
psqlomni
Or from source:
python -m psqlomni
Quick Setup
Set either a full DB URI (recommended) or individual DB fields.
Option 1: Full DB URI (recommended)
export DB_URI="postgresql+psycopg2://user:password@host:5432/dbname"
Option 2: Individual DB Fields
export DBDIALECT="postgresql"
export DBHOST="localhost"
export DBPORT="5432"
export DBNAME="mydb"
export DBUSER="myuser"
export DBPASSWORD="mypassword"
Model Provider
export MODEL_PROVIDER="openai"
export MODEL="gpt-4o-mini"
export OPENAI_API_KEY="your-key"
When values are missing, psqlomni prompts you interactively.
What It Does
- Converts natural language prompts into SQL
- Shows SQL for approval before execution
- Lets you edit SQL before running it
- Retries when SQL fails, then asks for approval again
- Keeps conversation history for follow-up questions
- Supports a normal mode and a verbose trace mode
Useful Commands
/help- list commands/connection- show active DB and model/connect- connect to another database/mode normal|verbose- switch output detail/provider- show or set provider/model- show or set model/new- start a new thread/resume <thread_id>- resume a thread/exit- quit
Safety
Every generated SQL query requires your approval before execution.
Docs
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file psqlomni-0.1.3.tar.gz.
File metadata
- Download URL: psqlomni-0.1.3.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddb93b81e568905a43e4e2623fb5a1037c8ad78bf17dc48da7ea2085cccfd6b6
|
|
| MD5 |
85450da293c21afb1ff65d2ce1bd1452
|
|
| BLAKE2b-256 |
f661e8544c20a2b01a6a0402b8c8cd21da3fcec8f3418172b7246b2995872ce6
|
Provenance
The following attestation bundles were made for psqlomni-0.1.3.tar.gz:
Publisher:
release.yml on emmakodes/psqlomni
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psqlomni-0.1.3.tar.gz -
Subject digest:
ddb93b81e568905a43e4e2623fb5a1037c8ad78bf17dc48da7ea2085cccfd6b6 - Sigstore transparency entry: 1040188551
- Sigstore integration time:
-
Permalink:
emmakodes/psqlomni@730b5d51831bd5998d5bf0205356710720ab4dc6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/emmakodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@730b5d51831bd5998d5bf0205356710720ab4dc6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file psqlomni-0.1.3-py3-none-any.whl.
File metadata
- Download URL: psqlomni-0.1.3-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c488bf762255574be5b986d25fa007595fe33b973982487b5cf0ab61b6066d12
|
|
| MD5 |
d80943edb2b71cb739166e891a864820
|
|
| BLAKE2b-256 |
c1d54a77b7a0425dfd7da35d1caeed71e1856e665bc3a7610ba44c1e099a3750
|
Provenance
The following attestation bundles were made for psqlomni-0.1.3-py3-none-any.whl:
Publisher:
release.yml on emmakodes/psqlomni
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psqlomni-0.1.3-py3-none-any.whl -
Subject digest:
c488bf762255574be5b986d25fa007595fe33b973982487b5cf0ab61b6066d12 - Sigstore transparency entry: 1040188818
- Sigstore integration time:
-
Permalink:
emmakodes/psqlomni@730b5d51831bd5998d5bf0205356710720ab4dc6 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/emmakodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@730b5d51831bd5998d5bf0205356710720ab4dc6 -
Trigger Event:
push
-
Statement type: