Skip to content

adamchainz/django-harlequin

Repository files navigation

django-harlequin

image

image

image

image

pre-commit

Launch Harlequin, the SQL IDE for your Terminal, with your Django database configuration.


Work smarter and faster with my book Boost Your Django DX which covers many tools to improve your development experience.


Requirements

Python 3.8 to 3.12 supported.

Django 3.2 to 5.0 supported.

Supported database backends: MariaDB/MySQL, PostgreSQL, SQLite.

Installation

First, install with pip:

python -m pip install django-harlequin

Second, install Harlequin with appropriate Harlequin adapter packages for the database backends you use. For example, to install Harlequin with the PostgreSQL adapter:

python -m pip install 'harlequin[postgres]'

Harlequin does not need to be installed in the same virtual environment as Django, as django-harlequin does not import it. You only need the harlequin command on your path, so you can install Harlequin globally, or in an isolated virtual environment with a tool like pipx.

Third, add the app to your INSTALLED_APPS setting:

INSTALLED_APPS = [
    ...,
    "django_harlequin",
    ...,
]

Usage

harlequin command

Run the harlequin management command to launch Harlequin, connected to your default database:

$ ./manage.py harlequin

Pass --database to select a different database connection from settings.DATABASES:

$ ./manage.py harlequin --database replica

Extra options, optionally after a -- delimiter, will be passed through to Harlequin. For example, to read its help page, as opposed to that of the management command:

$ ./manage.py harlequin -- --help

Configuration

Harlequin automatically loads configuration from pyproject.toml or its own files within the current working directory, which would mean next to your manage.py file. See Harlequin’s configuration documentation for details on the available options.

About

Launch Harlequin, the SQL IDE for your Terminal, with your Django database configuration.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages