hawkar20's comments

hawkar20 | 3 years ago | on: Ask HN: What are some mentally healthy apps to have?

> Do not open your web browser unless you have a specific search query in mind.

I'd counter this one. I've too often caught myself watching something, talking to friends or reading a books and being captured by the need to just quickly google that thing triggered by what I am doing at the moment. Most of the time you don't really need to know that information, your curiosity gets the better of you. Instead, maybe just make a quick note and stay in touch with that you're doing instead. Otherwise your life just becomes an endless list of interruptions prompted by needing to know that "one thing".

hawkar20 | 5 years ago | on: Show HN: Csql – Python lib for composeable SQL queries

I like what you've done here. I've personally gone down the route of using SQLAlchemy to build queries. The primary reason is that SQLAlchemy lets me build up reuseable SQL elements, to encapsulate business logic, like metrics and custom dimensions in Python. In particular SQLAlchemy's hybrid expressions, that allow you to tie an SQL expression to a ORM model are super useful for doing this sort of thing. There's also first class support for CTEs, window functions and other advanced SQL features. For me there's just something "dirty" about using raw SQL in code, or even templating it, even with security concerns like injection attacks put aside.

I second the recommendation for dbt. Especially if you're following an ELT architecture where you load your data into a data warehouse and then want to transform it. However dbt is more useful for transforming existing data, or aggregating data in batches. It's not a tool for generating SQL expressions on-the-fly like your library would allow you to do.

page 1