First steps with Harlequin
Today I used Harlequin for the first time. It is a SQL IDE for the terminal and the setup or installation was surprisingly easy.
I tried out the tool as part of my "elt-on-github-actions" repository (more information on that will follow). I wanted to test the conditional logic in my marts models: If it is the production environment, output to blob storage and if it is not, then create a view in the duckdb database.
Since I was already using uv to manage the dependencies of the dbt project, getting Harlequin to run was as simple as typing uvx harlequin database/dwh_local.duckdb. This command uses the shorthand notation for uv tool which runs the tool in another ephemeral environment. I then call Harlequin and point it to my local duckdb file.
That worked like a charm.
Handy shortcuts
There were also some useful keyboard shortcuts that I quickly picked up from the documentation's "Get oriented" guide.
ctrl + jto execute a queryctrl + wto clear the query editorctrl + nto open a new buffer (or tab) in the query editorF10for fullscreen mode, this is especially useful when browsing the results viewerF2to focus (again) on the query editorF6to focus on the data catalogue.on any database object to select options such as "view DDL" or "describe"ctrl + bto hide or show the data catalogue panecrtl + qto quit the program
Conclusion
Overall, I must say that I really like Harlequin. I was positively surprised by how quickly I was able to get it running in my project.
I am certain I will use it more often in the future considering its tight integration with uv and the ease-of-use once I picked up a few keyboard shortcuts.