This reads a lot like the style of Pandas I teach.[0] This seems to have resolved a problem with SQL, you can't read it in a linear fashion. When we start getting query optimizers for Pandas, much of the benefit of SQL will go away. [0] https://store.metasnake.com/effective-pandas-book
Show HN: PRQL 0.2 – a better SQL
141–150 of 166 posts
Re: Show HN: PRQL 0.2 – a better SQL
#142So I was hoping PRQL might have some sugar like that.
It'd be nicer for my brain if I could treat any select like a function that transforms a set. Instead, even with PRQL, I'm stuck examining source tables and fully understanding them before being able to understand the query.
Re: Show HN: PRQL 0.2 – a better SQL
#143Re: Show HN: PRQL 0.2 – a better SQL
#144I find SQL harder to work with because I'm used to reading and writing functions - functions that have explicit parameters with (hopefully) explicit types, and explicit return types. So I was hoping PRQL might have some sugar like that. It'd be nicer for my brain if I could treat any select like a function that transforms a set. Instead, even with PRQL, I'm stuck examining source tables and fully understanding them b…
Re: Show HN: PRQL 0.2 – a better SQL
#145I'm surprised that none of the examples on Github or the website deals with join. I eventually found some in the "book" here: https://prql-lang.org/book/transforms/join.html from employees join side:left positions [id==employee_id] turns into SELECT employees.*, positions.* FROM employees LEFT JOIN positions ON id = employee_id I would love to see joins worked into the main learning examples. Without join, the exampl…
Great point, we'll add that. I don't think we do joins that much better than SQL does. We're thinking whether there's potential there, maybe through understanding foreign keys — but we're being conservative about introducing change without value.
Re: Show HN: PRQL 0.2 – a better SQL
#146Earlier quoted context omitted.
Great point, we'll add that. I don't think we do joins that much better than SQL does. We're thinking whether there's potential there, maybe through understanding foreign keys — but we're being conservative about introducing change without value.
The biggest failure of SQL joins is not using declared foreign keys. For example it should be something like "JOIN USING fk_invoice_customer c" instead of repeating each time the relationship between invoice and customer entries already defined in foreign key
Re: Show HN: PRQL 0.2 – a better SQL
#147Somehow I didn't see it coming - > pronounced "Prequel". - and I burst out laughing. Very good.
Re: Show HN: PRQL 0.2 – a better SQL
#148Earlier quoted context omitted.
Great point, we'll add that. I don't think we do joins that much better than SQL does. We're thinking whether there's potential there, maybe through understanding foreign keys — but we're being conservative about introducing change without value.
The biggest failure of SQL joins is not using declared foreign keys. For example it should be something like "JOIN USING fk_invoice_customer c" instead of repeating each time the relationship between invoice and customer entries already defined in foreign key
Re: Show HN: PRQL 0.2 – a better SQL
#149I've thought about building a better query language too. I'd love the ability to model sum types in databases, something like: enum SchoolType { College { degrees: Vec }, HighSchool } It's such a common pattern and yet it's so annoying to model in a normal relational database. I wouldn't be surprised if the rise of NoSQL is tied to the inability of relational databases to model basic patterns like this. Part of me ha…
Re: Show HN: PRQL 0.2 – a better SQL
#150I've thought about building a better query language too. I'd love the ability to model sum types in databases, something like: enum SchoolType { College { degrees: Vec }, HighSchool } It's such a common pattern and yet it's so annoying to model in a normal relational database. I wouldn't be surprised if the rise of NoSQL is tied to the inability of relational databases to model basic patterns like this. Part of me ha…
Doesn’t Postgres support this with table inheritance https://www.postgresql.org/docs/current/tutorial-inheritance... I don’t know if they’re recommended, but they are an option.
They're incomplete (e.g. don't work with foreign keys) and are essentially unmaintained.