3 ms·
You mean it's impossible to have compile time type safety of sql queries, and that the compiler can't tell the difference between an SQL string and any other st
by saosebastiao 10y ago
You mean it's impossible to have compile time type safety of sql queries, and that the compiler can't tell the difference between an SQL string and any other string? You're wrong.
http://underscore.io/blog/posts/2015/05/28/typechecking-sql.html http://underscore.io/blog/posts/2015/05/28/typechecking-sql....
- mpweiher 10y agoNo, I most emphatically did not say (or mean) that it is impossible to check this statically. I am saying that this is first a modeling problem, you need to have a model for your SQL. You know, things like SqlStreamingAction[Vector[(String, Int)],(String, Int),Effect] After you have that model for your SQL you can decide whether you want to check it statically or not, but first you need the model. And yes, some languages allow you to decompose compile-time strings into model objects. Still requires you to have a model first, and I have to admit I prefer not having magic strings, but rather have polymorphic identifiers: http://objective.st/URIs http://objective.st/URIs