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.3.tar.gz (15.9 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.3-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

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

Hashes for psqlomni-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ddb93b81e568905a43e4e2623fb5a1037c8ad78bf17dc48da7ea2085cccfd6b6
MD5 85450da293c21afb1ff65d2ce1bd1452
BLAKE2b-256 f661e8544c20a2b01a6a0402b8c8cd21da3fcec8f3418172b7246b2995872ce6

See more details on using hashes here.

Provenance

The following attestation bundles were made for psqlomni-0.1.3.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.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

Hashes for psqlomni-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c488bf762255574be5b986d25fa007595fe33b973982487b5cf0ab61b6066d12
MD5 d80943edb2b71cb739166e891a864820
BLAKE2b-256 c1d54a77b7a0425dfd7da35d1caeed71e1856e665bc3a7610ba44c1e099a3750

See more details on using hashes here.

Provenance

The following attestation bundles were made for psqlomni-0.1.3-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