Slashdot Mirror


Type Safety Coming To DB Queries

An anonymous reader writes "A new type-safe query language for the popular full-text search platform Solr, called Slashem (a Rogue-like), has just been released. Slashem is implemented as a domain-specific language in Scala, providing compile time type-safety, allowing you do things like date range queries against date fields but keeping you from trying to do a date range query against a string field. Hopefully this trend catches on, resulting in fewer invalid queries exploding at runtime."

12 of 128 comments (clear)

  1. Gibberish - wrapped up as geekspeak by Anonymous Coward · · Score: 4, Insightful

    It's rogue-like and the link to define "rogue" is to a fucking github page that says "lift/mongodb query dsl".

      For fuck's sake... this tells people NOTHING. It's a completely useless article submission.

    1. Re:Gibberish - wrapped up as geekspeak by Samantha+Wright · · Score: 5, Funny

      This exactly.

      The server hits you with its internal schema!
      You cast SELECT * FROM ut_f81 INNER JOIN ut_f81 alt_ut_f81 ON alt_ut_f81.globalid = ut_f81.rrn / 2 WHERE (SELECT * FROM ut_f81 INNER JOIN ut_f81 alt_ut_f812 ON alt_ut_f812.globalid = alt_ut_f81.rrn / 2 WHERE (SELECT * FROM ut_f81 INNER JOIN ut_f81 alt_ut_f813 ON alt_ut_f813.globalid = ut_f81.rrn / 2 WHERE (SELECT 1 FROM ut_f81) = 1) = 1) = 1
      The server freezes, taking all of your work with it!

      Do you want your possessions identified?

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
    2. Re:Gibberish - wrapped up as geekspeak by Samantha+Wright · · Score: 3, Interesting

      That's probably because everyone else on the entire internet has already proposed. I think it's bad luck to try the same pickup line twice on the same woman.

      ...while it's flattering, I don't think my girlfriend would be too happy.

      --
      Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  2. Slashem, a roguelike by Xgamer4 · · Score: 5, Insightful

    ...Well, there's a namespace collision. There's Slashem and roguelike as referenced in the summary, and Slash'em and Roguelike as-in the Nethack-based game and the game genre. There's no way that wasn't intentional, and whoever's brilliant idea it was needs to be shot.

  3. Confusing much? by Aladrin · · Score: 3, Informative

    http://en.wikipedia.org/wiki/Roguelike

    Rogue-like has already been used. It's very confusing to say your DB query language is like a video game.

    --
    "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    1. Re:Confusing much? by Osty · · Score: 3, Informative

      Worse, Slash'EM is already the name of a (real) rogue-like (game). Obviously these guys are trying for a witty or clever play on "rogue-like" and "slashem", but it just comes off as confusing and lame.

  4. LINQ by bondsbw · · Score: 4, Interesting

    The title is incorrect; type safety is already available in DB queries, at least on Windows clients. You can use LINQ directly in C# and VB, or standalone via LINQPad.

    I'm all for new languages... but IMHO, I think LINQ is better. It looks more like SQL for all of us who already know SQL. It reads in the most logical order for word completion (select is after from/where, not before). And it's very carefully built on top of pure functional structures (SelectMany is equivalent to monadic Bind).

    --
    All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    1. Re:LINQ by shutdown+-p+now · · Score: 3, Interesting

      The difference between this and LINQ is that LINQ is more or less hardwired. Sure, it is just syntactic sugar for a bunch of method calls, and those methods can do anything they want, so there are many extensibility points; but you cannot add a new LINQ keyword from a C# library, for example - you're stuck with "select", "join", "orderby" etc.

      This one, on the other hand, only uses existing Scala constructs, with no need to alter the language itself.

      But, yeah, I wouldn't call it such a big difference in practice, so it's certainly not a first.

  5. WTH? by Blakey+Rat · · Score: 4, Funny

    I think that description might have been CleverBot making an attempt on the Turing Test. What the hell?

  6. Re:Dumbing it down by InsertCleverUsername · · Score: 3, Insightful

    This appears to be more of the 'nanny state' mentality that Microsoft is shoving down our throats.

    Sheesh... I was going to moderate a few items in this thread, but I just have to reply to your ignorant excuse to bash M$ --like they invented type-safety.

    This is the old case of narrowing the band of opportunity so that the lowest performers can't make the obvious mistakes. When will they realise that they are also stifling the highest performers? Give us some credit folks. We're not all first year out of college.

    Really? Technologies that help minimize errors through convention are a bad thing? So if you're in a shop that saves countless hours of time and debugging using a modern ORM like Hibernate, that makes you some sort of slack-jawed moron because "real" programmers do everything in assembly and don't need no stinkin' oversight, static code analysis, testing, or code review, right? Sheesh... Remind me not to hire you to code any systems where human safety is on the line. Most employers --even for inconsequential crap-- would rather have working apps than theoretically pure code; they can buy another rack of servers for what a good developer earns, so in most cases they really don't give a damn about efficient code.

    Besides, even if you think type-safety = training wheels, if you've been coding long enough, you'll see idiots and geniuses get slapped by typos and inadvertent mistakes. Only an amateur thinks they're immune to error and that things like type-safety just cramp your style. And real programmers can go around these things off when they need to, but take advantage of lower bug counts the rest of the time.

    --
    Ask me about my sig!
  7. Re:Reinventing the wheel by bug_hunter · · Score: 3, Informative

    Solr serves a different purpose to SQL. It is optimised for searching using text indexing with fancy ways of matching, weighting results when finding matches. Solr is actually a separate non-SQL database that you keep in sync with your real database. I've found it fits its purpose very well, and you rarely worry about the XML as library support handles it.
    SQL is great if you already know exactly what you're looking for. Solr is great if a human is performing a search.

    --
    It's turtles all the way down.
  8. I don't understand... by Chris+Mattern · · Score: 4, Funny

    How will getting the Amulet of Yendor get me type safety?