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.4.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.4-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: psqlomni-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ec0fc64b7212acce9f944450ddb2460c3cd948ea44d7736c7b96a872a2a66834
MD5 b71ad3c747721cbee770b0d628b4fd0c
BLAKE2b-256 ab3c2d5cf775a993759356d442105d3e2e70d34908f5e7ca71c778499028664a

See more details on using hashes here.

Provenance

The following attestation bundles were made for psqlomni-0.1.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: psqlomni-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8f78762c2f1f90c1379ac5066b22abdc929f2127459eef0d00e2a60916f5d17a
MD5 5cd601d943db8bbcf80c08e3f22b3798
BLAKE2b-256 ba2ac30fc89580bc9ea19cb850237fe8bee32c3ae83ebc335b5bbf0be6d62cc0

See more details on using hashes here.

Provenance

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