3 ms·
> query.SELECT('one').FROM('table') I don't really like this API. SQL is weird because it's written backwards. What does `query.SELECT("one")` on its own repre
by globular-toast 5y ago
> query.SELECT('one').FROM('table')
I don't really like this API. SQL is weird because it's written backwards. What does `query.SELECT("one")` on its own represent? A query on any table that happens to have a field called "one"? I know you're not trying to build an ORM, but `Table("table").select("one")` makes a lot more sense for an API since the object `Table("table")` actually has a purpose and would make sense to pass around etc.
- blackbear_ 5y agoI concur, despite the downvotes. This is also why the select is last LINQ to SQL [1] queries: var companyNameQuery = from cust in nw.Customers where cust.City == "London" select cust.CompanyName; [1] https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/getting-started https://docs.microsoft.com/en-us/dotnet/framework/data/adone...
- genericlemon24 5y ago> What does `query.SELECT("one")` on its own represent? data['SELECT'].append('one') I'm intentionally trying to not depart too much from SQL / list-of-strings-for-each-clause model, since I'd have to invent/learn another one. For a full-blown query builder, I agree Table("table").select("one") is better.
- gpderetta 5y agoalso select is really project (and where is select), but that's the battle for another day.