A tiny interactive SQL console for exploring SQLAlchemy/SQLModel models and executing ad-hoc SQL against your project's database.
- Quick start: Install consola and run the CLI to open an interactive REPL for your project with
consola start. - Async and Sync Engines: It supports both sync and async SQLAlchemy engines and bridges async sessions with a sync-style API.
Consola is not published on PyPI. Install it directly from GitHub.
uv tool install "consola @ git+https://github.com/Daniel-Brai/Consola.git"To install a specific version, append the tag:
uv tool install "consola @ git+https://github.com/Daniel-Brai/Consola.git@v0.1.0"pip install "consola @ git+https://github.com/Daniel-Brai/Consola.git"To install a specific version:
pip install "consola @ git+https://github.com/Daniel-Brai/Consola.git@v0.1.0"consola --helpI was inspired by the Rails Console in Ruby on Rails, a powerful interactive REPL that makes exploring models and querying the database effortless during development. I wanted the same convenience when working in Python projects that use SQLAlchemy/SQLModel. Consola brings that experience to Python by providing a lightweight, opinionated interactive console for inspecting models using Rails-like methods and running ad-hoc SQL using the model classes.
See LICENSE for details.