Metadata-Version: 2.4
Name: schemaingest
Version: 0.1.0
Summary: Introspect your PostgreSQL or MySQL/MariaDB schema through a web UI, without credentials leaving your machine.
Author: Jineth Bosilu
License-Expression: MIT
Project-URL: Homepage, https://github.com/JinethBosilu/SchemaIngest
Project-URL: Web UI, https://jinethbosilu.github.io/SchemaIngest/
Project-URL: Issues, https://github.com/JinethBosilu/SchemaIngest/issues
Keywords: postgres,postgresql,mysql,mariadb,schema,introspection,erd,database,llm
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: psycopg2-binary>=2.9.9
Requires-Dist: PyMySQL[rsa]>=1.1
Requires-Dist: pydantic>=2.5.0
Requires-Dist: click>=8.1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: httpx2>=2.0; extra == "dev"
Dynamic: license-file

# SchemaIngest

**A "gitingest"-style tool for databases.** Browse your PostgreSQL, MySQL or MariaDB schema in a web UI (tables,
columns, keys, indexes and an interactive relationship diagram), and copy a compact,
token-efficient description of it for an AI. Your credentials never leave your machine.

This package is the **local agent**. It runs on `127.0.0.1`, connects to your database
read-only, and serves the schema to the web UI at
<https://jinethbosilu.github.io/SchemaIngest/>.

## Install

```bash
pipx install schemaingest      # or: pip install schemaingest
```

Requires Python 3.10+.

## Use it with the web UI

```bash
schemaingest agent
```

The terminal shows a 6-digit **pairing code**. Open
<https://jinethbosilu.github.io/SchemaIngest/>, enter the code, then pick your database engine
and enter its connection details. They go only to the agent on `localhost`.

Chrome may ask whether the page can access devices on your local network. Allow it: that
is the browser checking before a public site talks to the agent on `127.0.0.1`.

## Use it without the web UI

```bash
# Full schema pack as JSON
schemaingest pull --conn "postgresql://user:pass@localhost:5432/mydb" --out schema.json

# Compact text, ready to paste into an AI
schemaingest pull --conn "postgresql://user:pass@localhost:5432/mydb" --out schema.txt --format txt

# MySQL or MariaDB: the scheme picks the engine
schemaingest pull --conn "mysql://user:pass@localhost:3306/mydb" --out schema.txt --format txt
```

For PostgreSQL, `--schema` picks a schema other than `public`. In MySQL a database is a
schema, so the database in the connection string is the one introspected. MySQL
connection strings accept `?ssl-mode=` with MySQL's values (`DISABLED`, `PREFERRED`,
`REQUIRED`, `VERIFY_CA`, `VERIFY_IDENTITY`).

## Security

- Binds to `127.0.0.1` only.
- CORS allows only the GitHub Pages UI and local development origins.
- A pairing code is required before any session is issued; sessions expire after 4 hours.
- Connections are opened read-only.
- Passwords are redacted from every printed error, and request bodies are never logged.

## License

MIT
