News for hackers. Stuff that matters.
Re:Select * from cloud by jayd16 on Friday September 30, 2022 @01:04PM (#33037468)
I also feel like part of the staying power of SQL is because it's the lingua franca of the database. I wonder if it's time to build and popularize some lower level language that could be targeted by ORMs and others to speak to DB engines. If we had a more flexible assembly language we might get more freedom at the programmer language level.
Re:Select * from cloud by johannes1234321 on Friday September 30, 2022 @01:10PM (#33037558)
MySQL has something in that direction, where some operations can be expressed as expression trees by using Protobuf where a client can put some arbitrary query language on top: https://dev.mysql.com/doc/internals/en/x-protocol-messages-m... it is still a bit limited, though (like no join ...)
Re:Select * from cloud by scarface74 on Friday September 30, 2022 @06:46PM (#33041709)
C# already does that, it converts LINQ to expression trees that are then converted by providers to their target query language. I’ve used it on one project to pass around the same query expressions to SQL server and Mongo - you pass a type of IQueryable<T> which represents an expression tree.

For instance

var seniors = query(from u in Users where u.Age > 65 && u.Sex == “male” select u)

IEnumerable<Users> query(IQueryable<Users>)