3 ms·
Great article! I wish all SQL libraries would adhere to this structure instead of forcing devs to write glorified (string) SQL. Ie., let me from(join(table
by lysium 13y ago
Great article! I wish all SQL libraries would adhere to this structure instead of forcing devs to write glorified (string) SQL. Ie., let me
from(join(table1, table2))
.where(table1.col1 > 10)
.groupBy(col1)
.project(col1, avg(col2))
and only in that order.
- chris_wot 13y agoHave you tried LINQ?
- deleted 13y ago[deleted]
- lukaseder 13y agoCheck out http://www.jooq.org http://www.jooq.org, by the same author as the article (me)
- lysium 13y agoLooks great! Do you happen to know whether jooq runs with DB2 v10? I see it supports DB2 v9.7.
- adad95 13y agohttp://www.linqpad.net/WhyLINQBeatsSQL.aspx http://www.linqpad.net/WhyLINQBeatsSQL.aspx
- batbomb 13y agoI wrote my own library in Java recently for something similar. It was inspired by LINQ and SQL grammar. Select statement = table1.select() .join(table2,[join condition]) .where(table1.col1.gt(10)) .groupBy(table1.col1) .selection(col1, Fn.avg(table1.col2)) Select s = new Select() .from(table1) .join(table2, table2.t1_col1.eq(table1.col1)) .where(table1.col1.gt(10)) .groupBy(table1.col1) .selection(col1, Fn.avg(table1.col2));
- andrewcooke 13y agohave you seen empire db? http://empire-db.apache.org/ http://empire-db.apache.org/ no-one much seems to use it, but it's actually quite neat.