Skip to main content

LLM-powered chat interface to your Postgres database - (psql powered with Natural Language)

Project description

psqlomni

Natural language chat for your SQL database.

Build Test Publish

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

psqlomni demo

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

psqlomni-0.1.5.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psqlomni-0.1.5-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file psqlomni-0.1.5.tar.gz.

File metadata

  • Download URL: psqlomni-0.1.5.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for psqlomni-0.1.5.tar.gz
Algorithm Hash digest
SHA256 8a3e7ffea867142cdd778e68875fbc0a6b80f5c19ad993446b828c394c076eda
MD5 5d4a3f31477b17beb05fd5da253e3de4
BLAKE2b-256 979fbdc2058553df3711391c50a5280f037e4e5dcf72433b72785cb86143127f

See more details on using hashes here.

Provenance

The following attestation bundles were made for psqlomni-0.1.5.tar.gz:

Publisher: release.yml on emmakodes/psqlomni

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file psqlomni-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: psqlomni-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for psqlomni-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 953508ed50a645195b2424849f505f2aac70295e93b6ecf068a324e240f28dcc
MD5 83bd53b29fb5e7d38b3ffadac1d4cd1d
BLAKE2b-256 b81704a943977eddb24e04cc7a7410c7d2501562589d935e7d057f7b43010037

See more details on using hashes here.

Provenance

The following attestation bundles were made for psqlomni-0.1.5-py3-none-any.whl:

Publisher: release.yml on emmakodes/psqlomni

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page