TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Deuterium – Fully typed SQL query builder for Rust

66 pointsby aethertapalmost 10 years ago

6 comments

antimoraalmost 10 years ago
It&#x27;s odd to call it DSL for SQL. SQL is DSL as it can be.<p>I honestly fail to see (&gt; 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?
评论 #9705108 未加载
评论 #9705187 未加载
评论 #9705600 未加载
ExpiredLinkalmost 10 years ago
Fully typed - where?<p><a href="https:&#x2F;&#x2F;github.com&#x2F;deuterium-orm&#x2F;deuterium&#x2F;blob&#x2F;master&#x2F;tests&#x2F;insert.rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;deuterium-orm&#x2F;deuterium&#x2F;blob&#x2F;master&#x2F;tests...</a><p>Table and column names are ... strings!
neverminderalmost 10 years ago
I would really like to see something similar to Slick (Scala) for Rust. This one says it&#x27;s an ORM, but a simple query compile time type checker (an example: <a href="http:&#x2F;&#x2F;slick.typesafe.com&#x2F;doc&#x2F;3.0.0&#x2F;sql.html" rel="nofollow">http:&#x2F;&#x2F;slick.typesafe.com&#x2F;doc&#x2F;3.0.0&#x2F;sql.html</a>) would already be great.
评论 #9705325 未加载
评论 #9705327 未加载
looneysquashalmost 10 years ago
I&#x27;ve never met one of these that I&#x27;m truly in love this.<p>This one looks like you don&#x27;t use POD types, you use it&#x27;s special types for the output of columns and rows.<p>I don&#x27;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&#x27;t have an &quot;id&quot; yet. And that &quot;created&quot; timestamp field should really be the &quot;DEFAULT&quot; keyword in the insert statement too!<p>Then you have select queries that don&#x27;t return all of columns, or that call functions and return extra columns. Do you define a struct for each query by hand?
allan_salmost 10 years ago
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.
ragna_rock_rockalmost 10 years ago
in Haxe with SPOD you can have a SQL DSL thanks to macro. for example<p>User.manager.delete($id &gt; 1000);<p>User.manager.search($name in [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]);<p>User.manager.search($id == 1 &amp;&amp; { name : &quot;Nicolas&quot; }) User.manager.search($id &lt; 10 &amp;&amp; if( name == null ) true else $name == name)<p><a href="http:&#x2F;&#x2F;old.haxe.org&#x2F;manual&#x2F;spod" rel="nofollow">http:&#x2F;&#x2F;old.haxe.org&#x2F;manual&#x2F;spod</a>