It's odd to call it DSL for SQL. SQL is DSL as it can be.<p>I honestly fail to see (> cost) benefits of such tool. I realize it adds an additional layer abstraction which one could use to build additional functionalities on top, such as dialect translation, metadata emission. But why one would want to pay the cost of learning the new API and adhering limitation. For example, it is missing upsert feature. So what one supposed to do in this case?
I would really like to see something similar to Slick (Scala) for Rust. This one says it's an ORM, but a simple query compile time type checker (an example: <a href="http://slick.typesafe.com/doc/3.0.0/sql.html" rel="nofollow">http://slick.typesafe.com/doc/3.0.0/sql.html</a>) would already be great.
I've never met one of these that I'm truly in love this.<p>This one looks like you don't use POD types, you use it's special types for the output of columns and rows.<p>I don't even know how to solve these problems. Perhaps I want something not possible.<p>You have some struct that represents your table. You want to insert into the table. You try to fill out your struct, but wait, you don't have an "id" yet. And that "created" timestamp field should really be the "DEFAULT" keyword in the insert statement too!<p>Then you have select queries that don't return all of columns, or that call functions and return extra columns. Do you define a struct for each query by hand?
i already created a ticket on github for this project, but I think it would be useful if rust libraries on github state if they build against 1.0.0 or against nightly , that would help chosing library.
in Haxe with SPOD you can have a SQL DSL thanks to macro.
for example<p>User.manager.delete($id > 1000);<p>User.manager.search($name in ["a","b","c"]);<p>User.manager.search($id == 1 && { name : "Nicolas" })
User.manager.search($id < 10 && if( name == null ) true else $name == name)<p><a href="http://old.haxe.org/manual/spod" rel="nofollow">http://old.haxe.org/manual/spod</a>