adamchainz,
@adamchainz@fosstodon.org avatar

✍️ New post on my new package django-harlequin.

🦆 This package provides a small launcher command for Harlequin, the Terminal-based SQL IDE by Ted Conbeer.

💽 Try it out and let me know what you think!

https://adamj.eu/tech/2024/05/07/django-harlequin/

benjaoming,
@benjaoming@social.data.coop avatar

@adamchainz NICE! Could be cool that a project is ready to run with harlequin when needed by the developer/admin (maybe outside the project env possibly?). It's useful in both development and production.

Can the manage.py harlequin provide help when harlequin and/or adapter doesn't exist?

> Harlequin was not detected. You should install it outside your project's env:
>
> pip -u install 'harlequin[postgres]'

adamchainz,
@adamchainz@fosstodon.org avatar

@benjaoming I’ve just pushed a release that explicitly depends on Harlequin, so it should always be installed. I think Harlequin itself should have a good enough error when the adapter isn't installed?

benjaoming,
@benjaoming@social.data.coop avatar

@adamchainz Since Harlequin contains its own stack of dependencies, isn't it better to install in an environment that's external to the Django project's? I mean, if possible!

There's also the whole footprint of packages.. it's a bit huge :)

benjaoming,
@benjaoming@social.data.coop avatar

@adamchainz When I tried installing Harlequin in a random local venv (from 2023):

> ERROR: pip's dependency resolver (...)
> virtualenv 20.20.0 requires platformdirs<4,>=2.4, but you have platformdirs 4.2.1 which is incompatible.

(this is easy to fix, but not unrelated to adding it into the project's venv.. less nice if debugging production)

It has some loose dependencies on jinja2&lt;4.0,&gt;=3.0 and pygments&lt;3.0.0,&gt;=2.13.0 that could change and become more interfering, too?

adamchainz,
@adamchainz@fosstodon.org avatar

@benjaoming Yeah it has a lot of unnecessary upper version bounds... Maybe it would be better to not have it as a dependency, allowing pipx installs etc. I think I will roll that back, later.

benjaoming,
@benjaoming@social.data.coop avatar

@adamchainz super - it was just the input that I had from trying it out. I can make it work for my projects, and trying out Harlequin was really very very promising, so thank you for making it so easy 🫶

adamchainz,
@adamchainz@fosstodon.org avatar

@benjaoming Thank you for helping make it better! I just merged your PR and released a version with the dependency removed.

e11bits,
@e11bits@fosstodon.org avatar

@adamchainz Didn't know about harlequin and it's great to have a shortcut from , when tinkering with it. Only thing was that the django-harlequin package does not have harlequin itself as a dependency? In the end harlequin seems not to be my thing. The 90s norton commander vibe and especially the key bindings. And installing harlequin pulls in 29 packages with ~400MB by itself (10 x django), among them numpy, pyarrow. In my case a bit much for the occasional SQL queries I do.

adamchainz,
@adamchainz@fosstodon.org avatar

@e11bits The lack of dependency was an oversight that I just released a fixed version for.

Yeah, it’s a bit heavy, maybe that could be worked on upstream.

e11bits,
@e11bits@fosstodon.org avatar

@adamchainz For my own use I just modified the django-harlequin package to not use harlequin, but 🥁 😆 . It works quite well for sqlite with emacs sqlite-mode and should work for postgresql with pgmacs as well.

https://github.com/emarsden/pgmacs

adamchainz,
@adamchainz@fosstodon.org avatar

@e11bits Oh, cool. Publish as django-pgmacs!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • django
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • cubers
  • osvaldo12
  • JUstTest
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • megavids
  • anitta
  • provamag3
  • lostlight
  • All magazines