Skip to main content

SQLite forensic analysis with local LLMs — ask questions in plain English

Project description

yourSQLfriend

Connect SQLite databases to a local LLM. Ask questions in plain English, get SQL queries and results.

Built for offline forensic analysis on a single workstation — no cloud, no telemetry, nothing leaves your machine.

Version License Python Flask

yourSQLfriend — load a database and get started

yourSQLfriend is for analysts, investigators, and developers who need to interrogate SQLite databases without sending data anywhere. Load a .db, .sqlite, .csv, or .sql file, ask questions in plain English, and get parameterised read-only SQL with full results — air-gap safe, forensic-grade.


✨ Features

🔒 100% Offline Runs on a local LLM via Ollama or LM Studio. Zero telemetry, air-gap safe
💬 Natural Language Ask "show me the top 5 customers" and get results + the exact SQL query
🔍 Search All Tables Find a value across your entire database (⌘K / Ctrl+K)
🪟 Three-Pane Workbench Schema browser · conversation · Row Inspector
🔎 Row Inspector Click any result row to expand it; foreign keys become clickable links
🕘 Query History Per-session panel of every question asked; click to jump back to that turn
📋 Interactive Tables Sort, filter, paginate results with dark/light theme
💾 Export Sessions Save your entire chat session as a formatted HTML file with hashes + timestamps
🖥️ Install as App PWA support — install as a standalone desktop app from Chrome/Edge/Brave

yourSQLfriend is a desktop-first workbench: on narrow screens (below ~880px) the schema browser and Row Inspector are hidden by design.

Ask a question in plain English — the LLM writes parameterised read-only SQL, runs it, and returns results you can sort, filter, and export.

Workbench — question, generated SQL, and paginated results
Schema browser & query history

Browse all tables, columns, types, and row counts in the left pane. Query history lives at the bottom — click any entry to jump back.

Schema browser and query history
Row Inspector

Click any result row to expand it. Foreign key references become navigable links — follow relationships without writing another query.

Row Inspector with foreign key navigation

🤖 LLM Setup

yourSQLfriend requires a local LLM running before you launch. Set one up first:

Option A: Ollama

ollama pull gemma4:26b
ollama serve

Option B: LM Studio

  1. Download LM Studio
  2. Load a model
  3. Start local server on port 1234

Once connected, the provider indicator in the top bar turns green.

Settings panel — provider connected

Context window: The system prompt is token-heavy by design. A 16K context window is the minimum; 32K or more is strongly recommended for complex schemas.

LLM model sizes: Smallest → 4B | Mid → 8-9B | Large → 14B | Largest → 26-30B

Recommended LLM families: Qwen | Gemma | Mistral / Devstral

Choosing a model

General chat models (the families above) are the flexible default — they explain schemas well and hold a conversation. If your sessions are SQL-heavy and you're seeing too many failed queries, try a SQL-specialized model: Arctic-Text2SQL-R1-7B (GGUF) outperforms GPT-4o on text-to-SQL benchmarks despite being a 7B model, and loads in LM Studio like any other GGUF. Trade-off: it's a Qwen2.5-Coder fine-tune, so its prose explanations are terser than a general chat model's. A/B both against your own database and keep whichever fails less.


🚀 Quick Start

Prerequisite: Python 3.10+ must be installed, and your LLM must be running (see above).

Linux / macOS

curl -fsSL https://raw.githubusercontent.com/reisset/yourSQLfriend/main/install.sh | sh

Windows (PowerShell)

irm https://raw.githubusercontent.com/reisset/yourSQLfriend/main/install.ps1 | iex

Then launch from any terminal: yoursqlfriend

Options: yoursqlfriend --port 8080, --no-browser, --host 0.0.0.0

Note: The Flask server must be running for the app to work. yoursqlfriend starts it automatically — do not close the terminal.

Updating

Re-run the install one-liner above — it upgrades an existing installation in place. Or, equivalently:

pipx upgrade yoursqlfriend
Install with pipx (manual)
pipx install yoursqlfriend
From source (developers)
git clone https://github.com/reisset/yourSQLfriend.git
cd yourSQLfriend
./run.sh          # Linux/macOS
run.bat           # Windows

🛡️ Forensic Integrity

Read-only guaranteed SQL validation + SQLite mode=ro block all writes
Chain of custody SHA256 hashes logged, timestamped exports
Audit logs All queries logged to logs/ with daily rotation
Air-gap safe Zero telemetry, works fully offline

WAL files: The upload process excludes .db-wal and .db-shm files. Checkpoint your database first to ensure recent transactions are included.


⚠️ Known Limitations

  • Model quality matters. Smaller models will produce incorrect or incomplete SQL on complex schemas. If results look wrong, the query is the first thing to check.
  • SQLite only. No support for Postgres, MySQL, or other engines.
  • Single database per session. You can replace the loaded database mid-session, but results from different databases are not cross-queryable.
  • Complex queries may fail. Heavily nested subqueries, window functions, and non-standard SQLite extensions may exceed what the LLM generates reliably.

📂 Data Storage

All data lives in your home directory:

Platform Path
Linux / macOS ~/.yourSQLfriend/
Windows %APPDATA%\.yourSQLfriend\

Contains uploads/, logs/, and sessions/.


Apache 2.0 — see LICENSE and NOTICE

Built by Reisset

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

yoursqlfriend-3.14.0.tar.gz (754.7 kB view details)

Uploaded Source

Built Distribution

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

yoursqlfriend-3.14.0-py3-none-any.whl (767.1 kB view details)

Uploaded Python 3

File details

Details for the file yoursqlfriend-3.14.0.tar.gz.

File metadata

  • Download URL: yoursqlfriend-3.14.0.tar.gz
  • Upload date:
  • Size: 754.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yoursqlfriend-3.14.0.tar.gz
Algorithm Hash digest
SHA256 9331c078e0c48756ff94d73a400bd2403e88d7592f34f5e3a7c41b18f087bace
MD5 3eb82b511993cb16420740e160712635
BLAKE2b-256 745016f5592f22b5b1f7fcc6377e17b02a25f8d2519ccd6c076293538ab84114

See more details on using hashes here.

Provenance

The following attestation bundles were made for yoursqlfriend-3.14.0.tar.gz:

Publisher: publish.yml on reisset/yourSQLfriend

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

File details

Details for the file yoursqlfriend-3.14.0-py3-none-any.whl.

File metadata

  • Download URL: yoursqlfriend-3.14.0-py3-none-any.whl
  • Upload date:
  • Size: 767.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yoursqlfriend-3.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8ca7e09d38c97a4b7605397654265a5219fa10be98d014578cee84c6498654a
MD5 653b75b6adf8e9feb96354f0486e11f0
BLAKE2b-256 7faa604705c4446964d35266d07c578e8e8c37b070ddd0735b1a116598b059c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for yoursqlfriend-3.14.0-py3-none-any.whl:

Publisher: publish.yml on reisset/yourSQLfriend

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