Inline SQL

Languages and libraries

python library

SHOW HN2022

26points
13comments
#1,333of 2,570 in 2022
Top 52%of 2022 by points

How HN took it

MixedNo clear lean

4 positive, 2 neutral or asking, 0 mixed, 1 critical, out of 7 comments about the project. Thread score +0.26.

Design: 2 for, 1 againstIdea: 2 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Clean, cool syntax and idea

    From 3 comments
    • Very cool, I have lots of ideas of how to leverage it for windmill.dev. We were using psycopg2 for all our examples but this is much cleaner. Thanks for sharing!
      rubenfiszel on HN
    • This is great. I have a personal-use version of this (also using DuckDB's fantastic Pandas compatibility) and will see if I can just switch over.
      lazzlazzlazz on HN
    • These are good points, especially around the magic substitution. I hadn’t really considered that. Even so, pandas has the same magic substitution going on with just a standard…
      orf on HN

Objections

  • The ^ operator is an unusual choice for syntax

    From 2 comments
    • Looks really interesting, but why overload the ^ operator? Is a function call really that much more verbose?
      orf on HN
    • These are good points, especially around the magic substitution. I hadn’t really considered that. Even so, pandas has the same magic substitution going on with just a standard…
      orf on HN

Requests

  • Support for dataclasses and dict containers

    From 1 comment
    • This is awesome. Is there a way to get it to work with e.g. dataclasses-sql? I am thinking of something such as ``` stuff: list[mydataclass] sql_val^ "select * from stuff where…
      pizza on HN

Questions

  • Is the interpolation parameterized, avoiding SQL injection?

    From 1 comment
    • Something was not clear to me from the README. When you do string interpolations as in your examples, those are actually prepared sql statements right ? Otherwise it would open…
      rubenfiszel on HN

Alternatives named

  • Pandas function calls

    From 2 comments
    • Hm, you're currently able to do this through Pandas. ``` stuff: list[mydataclass] stuff_df = pd.DataFrame(stuff) results = sql^ "SELECT * FROM stuff_df WHERE field = 2" ``` My…
      ekzhang on HN
    • These are good points, especially around the magic substitution. I hadn’t really considered that. Even so, pandas has the same magic substitution going on with just a standard…
      orf on HN
  • psycopg2

    From 1 comment
    • Very cool, I have lots of ideas of how to leverage it for windmill.dev. We were using psycopg2 for all our examples but this is much cleaner. Thanks for sharing!
      rubenfiszel on HN
  • dataclasses-sql

    From 1 comment
    • This is awesome. Is there a way to get it to work with e.g. dataclasses-sql? I am thinking of something such as ``` stuff: list[mydataclass] sql_val^ "select * from stuff where…
      pizza on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/33132820)