Live data from Hacker News

Harlequin: SQL IDE for Your Terminal

github.com

41–50 of 89 posts

Re: Harlequin: SQL IDE for Your Terminal

#41

Earlier quoted context omitted.

And this works with every existing Python project out there? What about `requirements.txt` projects?

requirements.txt is just a list of packages for pip. It doesn't even need to be called requirements.txt, it could be called poopoopeepee.txt. That name is just a convention. You could do `for line in requirements.txt, pip install `. They are ostensibly the same. It is not a magical lockfile. It is unix. It is just a list if packages. If you are in a virtualenv, you will be fine. either activate the venv, source venv_…

alright, I will bookmark this and try this next time I want to play with a python project.

OK, how would I include all of these under the same PATH regime?

So for example say I want to run this project from a commandline location elsewhere... I'd only be able to have one venv activated at the same time in the same session, right?

I guess that's part of my issue with this. I want to be able to access 10 different Python projects' commands from the same command line at any time.

Re: Harlequin: SQL IDE for Your Terminal

#43

Earlier quoted context omitted.

every project you have should be in a virtual environment. it is not hard. https://docs.python.org/3.12/library/venv.html python -m venv ~/my-venvs/ source ~/my-venvs/name/bin/activate pip install but stuff like this would usually get installed globally, and your projects would instead have a venv. personally my favorite tool is pyenv, which allows you to have many versions of python on your machine as well as many v…

Yeah. I've heard this same comment before in different forms from "Python apologists" about a dozen times. In practice it's still a lot of hair-pulling, because your entire comment assumes that EVERY Python project is already doing things exactly this way and hasn't screwed up a single part of it: https://twitter.com/pmarreck/status/1735363908515295253 but also... > but stuff like this would usually get installed glo…

Your Tweet shows that you don't actually know what these tools do. There's not much overlap in functionality between Pyenv, Tox, and Poetry, for example.

Also, nobody active in the Python community will argue that there's 1 correct way to do packaging. That's a serious straw man.

Fortunately, none of those tools you mentioned other than venv are actually required to run Python applications, and there are in fact exactly 2 recommended ways to install Python applications:

1) Use your system's package manager

2) Use a venv, either manually (as shown in the sibling comment) or using the Pipx tool, which just creates venvs for you.

All of the other tools you mentioned (except for Pyenv) represent ~20 years of active development and iteration on how to manage projects and build packages for distribution, and end-users shouldn't even have to be aware of their existence. And Pyenv is just Rbenv but for Python.

As I've pointed out elsewhere, this is exactly the same situation as with literally every other programming language that doesn't generate standalone executables, and is even a problem with those that do, if they rely on dynamic linking. The special ire towards Python in this case is neither warranted nor valid.

Your pinned post on Twitter is predicated on double standards and lack of basic understanding of the tools you're criticizing. I'm not sure that's a good way to represent oneself.

Re: Harlequin: SQL IDE for Your Terminal

#44

Earlier quoted context omitted.

requirements.txt is just a list of packages for pip. It doesn't even need to be called requirements.txt, it could be called poopoopeepee.txt. That name is just a convention. You could do `for line in requirements.txt, pip install `. They are ostensibly the same. It is not a magical lockfile. It is unix. It is just a list if packages. If you are in a virtualenv, you will be fine. either activate the venv, source venv_…

alright, I will bookmark this and try this next time I want to play with a python project. OK, how would I include all of these under the same PATH regime? So for example say I want to run this project from a commandline location elsewhere... I'd only be able to have one venv activated at the same time in the same session, right? I guess that's part of my issue with this. I want to be able to access 10 different Pyth…

To access 10 different commands at the same time, that is tricky but definitely doable.

First thing that comes to mind, you can use aliases.

To keep it simple, lets use 3 examples instead of 10: harlequin (this project), pgcli (https://www.pgcli.com/) and httpx (https://www.python-httpx.org/)

Setup a main home for all your venvs:

    cd ~
    mkdir venvs
Go into this dir, and create your venvs and install the packages

    cd venvs
    python -m venv harlequin
    ~/venvs/harlequin/bin/pip install harlequin
Now this binary is available at

    $ ~/venvs/harlequin/bin/harlequin
Repeat for the rest

    cd ~/venvs
    python -m venv pgcli
    ~/venvs/pgcli/bin/pip install pgcli

    cd ~/venvs
    python -m venv httpx
    ~/venvs/pgcli/bin/pip install httpx
Wash, rinse, repeat. Now you have all these binaries available and can alias them

    alias harlequin="~/venvs/harlequin/bin/harlequin"
    alias pgcli="~/venvs/pgcli/bin/pgcli"
    alias httpx="~/venvs/httpx/bin/httpx"
This is a pain in the ass though and usually simple CLI tools like this do not collide with each other. So that is why I say install globally, or install into your "global junk drawer" virtualenv.

Meanwhile, for actual projects that you are developing on, those would have their own isolated venv.

I have a junk drawer venv where I install tools like this. If something goes wrong, it is as simple as rm -rf the venv and make a new one. And then I have isolated ones for each of the actual systems I maintain. Again, I use pyenv for this to make it a little easier to manage in conjunction with their specific python versions such that I do not ever interact with my distribution's Python. This is cross platform so it works across mac, linux etc. Very easy workflow, isolated, safe, can get blown away and recreated in a heartbeat.

Re: Harlequin: SQL IDE for Your Terminal

#45
post #4

Suggestion: under "works with your database" consider naming the databases rather than only offering a list of icons. Also seems to be a bit of hubris to claim a SQL IDE "works with your database" when SQL Server and Oracle, two of the database products with the largest market share, are not supported (yet?)

> SQL Server and Oracle Alright so first off, for 90% of SQL Server's existence, Microsoft was openly open-source-hostile, so give me a fucking break with this. Microsoft used to be way worse than even Apple about keeping everything in their ecosystem- at least Apple is built on BSD underpinnings and was therefore also always compatible with POSIX stuff. Oracle... last I checked on that monstrosity it had about 20 di…

> give me a fucking break

No we won't :)

https://pypi.org/project/pyodbc/

Re: Harlequin: SQL IDE for Your Terminal

#47

The horizontal scroll animation on the query results table is fascinating. Never seen animations like that in a TUI app.

https://textual.textualize.io/

That's impressive! Anyone know if there are similar libraries available for other languages?

Re: Harlequin: SQL IDE for Your Terminal

#49
post #36

Earlier quoted context omitted.

I made a simple CLI wrapper that automates this, like Poetry does, except my wrapper uses pip. https://github.com/jzombie/pipper

Have you seen Pipx or its predecessor Pipsi? Although your tool looks more like Virtualenvwrapper. It's good to have other options of course (and yours looks nice), but it's also good to at least make a case for improvement over what's already out there.

Thank you.

I have, actually (though not Pipsi). Some others have commented on that and lead me to them.

Part of the "fun" of it was just doing it, I guess, and knowing exactly what went into it. Just a few lines of Bash, really.

Post reply on HN