[{"data":1,"prerenderedAt":210},["ShallowReactive",2],{"project-33132820":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":41,"post_text":44,"what":45,"said":80,"maker_in_thread":130,"shape":137,"grid":141,"attempts":170,"same_week":171,"maker_shows":201,"maker_hidden":202,"reader_version":203,"card":204},"33132820","Inline SQL","Inline SQL in any Python program","title","Show HN: Inline SQL in any Python program","https:\u002F\u002Fgithub.com\u002Fekzhang\u002Finline-sql","github.com","ekzhang",1665241037,2022,26,13,1333,2570,52,"shown","languages","python library","library",[24,25,26,27,28],"python","sql","dsl","duckdb","pandas","mixed",0.262,{"positive":32,"neutral":33,"mixed":34,"critical":35},4,2,0,1,7,{"idea":38,"design":39,"docs":40},{"positive":33,"critical":34},{"positive":33,"critical":35},{"positive":34,"critical":34},[42,34,43,42,34,35,34,42,43,34,42,34,34],5,3,null,{"problem":46,"audience":53,"pricing":44,"motivation":44,"time_to_build":44,"stack":64,"openness":79,"stage":79,"team_size":79},{"value":47,"source":48,"evidence":49},"Writing SQL queries against Python data is clunky with function-call APIs","inferred",[50],{"id":51,"by":11,"text":52},"33135352","Thanks for the feedback orf! I agree it looks strange at first, this is very experimental so I played a bit with syntax design choices. Sometimes for DSLs it's nice to have a bit…",{"value":54,"source":48,"evidence":55},"Python programmers who query data with SQL",[56,60],{"id":57,"by":58,"text":59},"33136278","lazzlazzlazz","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.",{"id":61,"by":62,"text":63},"33135300","rubenfiszel","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!",[65,70,75],{"value":66,"source":48,"evidence":67},"Python",[68],{"id":69},"post",{"value":71,"source":72,"evidence":73},"DuckDB","commenter",[74],{"id":57,"by":58,"text":59},{"value":76,"source":72,"evidence":77},"Pandas",[78],{"id":57,"by":58,"text":59},"unknown",{"praise":81,"objections":91,"requests":99,"questions":107,"alternatives":114},[82],{"value":83,"source":72,"evidence":84},"Clean, cool syntax and idea",[85,86,87],{"id":61,"by":62,"text":63},{"id":57,"by":58,"text":59},{"id":88,"by":89,"text":90},"33136024","orf","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…",[92],{"value":93,"source":72,"evidence":94},"The ^ operator is an unusual choice for syntax",[95,98],{"id":96,"by":89,"text":97},"33134765","Looks really interesting, but why overload the ^ operator? Is a function call really that much more verbose?",{"id":88,"by":89,"text":90},[100],{"value":101,"source":72,"evidence":102},"Support for dataclasses and dict containers",[103],{"id":104,"by":105,"text":106},"33136682","pizza","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…",[108],{"value":109,"source":72,"evidence":110},"Is the interpolation parameterized, avoiding SQL injection?",[111],{"id":112,"by":62,"text":113},"33135428","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…",[115,122,126],{"value":116,"source":72,"evidence":117},"Pandas function calls",[118,121],{"id":119,"by":11,"text":120},"33137999","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…",{"id":88,"by":89,"text":90},{"value":123,"source":72,"evidence":124},"psycopg2",[125],{"id":61,"by":62,"text":63},{"value":127,"source":72,"evidence":128},"dataclasses-sql",[129],{"id":104,"by":105,"text":106},{"comments":32,"answered":43,"key":131},[132,133,136],{"id":119,"text":120},{"id":134,"text":135},"33135379","That's great! There's nothing I would be happier to hear than this experiment making someone think of query languages a little differently. :)",{"id":51,"text":52},{"commenters":138,"max_depth":43,"maker_replies":32,"first_comment_mins":139,"lifespan_hours":140},6,220,75,[142,144,146,149,151,153,155,157,158,160,163,164,168],[104,34,42,143,105,34],"project\u002Fpositive\u002Fidea",[119,34,34,145,11,35],"maker\u002Fneutral\u002Fidea",[147,34,43,148,105,34],"33166880","project\u002Fneutral\u002Fidea",[61,35,42,150,62,34],"project\u002Fpositive\u002Fdesign",[134,35,34,152,11,35],"maker\u002Fpositive\u002Fidea",[96,33,35,154,89,34],"project\u002Fcritical\u002Fdesign",[51,33,34,156,11,35],"maker\u002Fneutral\u002Fdesign",[88,33,42,150,89,34],[112,43,43,159,62,34],"project\u002Fneutral\u002Fdocs",[161,43,34,162,11,35],"33135606","maker\u002Fneutral\u002Fexecution",[57,32,42,143,58,34],[165,42,34,166,167,34],"33135079","other\u002Fneutral\u002Fnone","biggerChris",[169,42,34,166,105,34],"33136677",[],[172,177,182,187,192,197],{"id":173,"name":174,"points":175,"category":176},"33155074","InvokeAI",414,"ai",{"id":178,"name":179,"points":180,"category":181},"33153152","agreper",392,"infrastructure",{"id":183,"name":184,"points":185,"category":186},"33147079","Pages on Pages",345,"web_saas",{"id":188,"name":189,"points":190,"category":191},"33150086","playlists.dags.dev",295,"consumer_social",{"id":193,"name":194,"points":195,"category":196},"33164922","Open-Sourcing InboxSDK (YC S11)",257,"dev_tools",{"id":198,"name":199,"points":200,"category":196},"33115719","Lambda-8cc",249,9,false,"v2",{"id":205,"name":5,"line":6,"ai":202,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":206,"top":18,"kw":207,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":208,"url":9,"mix":209,"praise":83,"objection":93,"sub":21},33132820,0.26,[24,25,26,27,28],"5035010530500",[32,33,34,35],1794036625918]