Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6866991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:15:09+00:00 2026-05-27T03:15:09+00:00

Update Play 2.0’s Scala version will feature ANORM , which seems similar to Querulous

  • 0

Update

Play 2.0’s Scala version will feature ANORM, which seems similar to Querulous in that both are JDBC wrappers and not ORMs. Here’s ANORM query coercion at work with a parser combinator:

SQL("""
        select * from Country c 
        join CountryLanguage l on l.CountryCode = c.Code 
        where c.code = 'FRA';
    """
    ).as(
        str("name") ~< spanM(
            by=str("code"), str("language") ~< str("isOfficial") 
        ) ^^ { 
            case country~languages => 
                SpokenLanguages(
                    country,
                    languages.collect { case lang~"T" => lang } headOption,
                    languages.collect { case lang~"F" => lang }
                )
        } ?
    )

The multi-line query “”” sql “”” is nice, I like that, but the coercion, please, no 😉 In Groovy, bean coercion with the same query is a 1-liner:

List[Country] c = sql.rows("select * from country")?.collect{ it.toRowResult() as Country }

the null safe operator (?.might-be-null) in groovy is quite convenient, scala seems to require the Some() Option[] combo to deal with possible null outcomes. Do Scala coders like null handling in Scala?

I guess the general thrust of this post is: can Scala provide scripting language concision while retaining compiler type safe code? Given that Scala is perhaps more powerful/expressive than C# (unintentional flame), then a full blown Scala LINQ must be possible. Furthermore, since Scala straddles the functional and OO paradigms, then it must also be able to achieve Groovy level concision (for example, the 1-liner query-bean-coercion above).

If these assumptions are true, then why do the existing scala ORMs and jdbc wrappers require so much boilerplate compared to groovy and LINQ on C#? Obviously I am an idealist looking for bare bones DSLs where implementations are either incredibly concise, or closely mirror the underlying language they represent (as in LINQ-to-SQL).

Original

Have been taking a run through the various Scala ORMs (squeryl, daomapper, couple others will fill in later) and SQL helper frameworks (querulous so far)

Being new to Scala and strongly typed languages in general, one thing that leaps out at me is the need to specify the type (String, Int, etc.) of each column in every query result.

About to get on an overnight train here, but this struck me just now, so putting it out there (will add some examples when I get back online again to make this a bit of less of a ramble)

For now, a quick one from Querulous’s readme on github:

val users = queryEvaluator.select("SELECT * FROM users WHERE id IN (?) OR name = ?", List(1,2,3), "Jacques") { row =>
  new User(row.getInt("id"), row.getString("name"))
}

While I understand that the compiler needs to know the type of every “object” you work with, it seems non-DRY to have to specify “row.getInt(‘id’)” when the domain class itself already declares that id is of type Int.

So, coming from a fair degree of ignorance, I will ask, why do Scala ORMs and SQL helper frameworks not provide developers with an implementation model that allows for inferred or implicit result sets?

Just to put in context, I am coming from Grails, which has an, imo, excellent domain/validation model among other framework nice-to-haves, but suffers from dynamic language time wasting fat-finger typing (startup time is painful as well) which is why I am exploring Scala frameworks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:15:10+00:00Added an answer on May 27, 2026 at 3:15 am

    See Scala Integrated Query as I understand it is scheduled to be integrated in the typesafe stack as Scala Language Integrated Connection Kit (SLICK)

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Play frameworks comes with an old Hibernate version (3.6.1). How can I update Hibernate
m making an app which requires to play recorded audio files. For that m
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
I'm developing an application that will most likely be preinstalled on devices. It will
I am just beginning to play around with .NET (using C#). Which namespace, aside
I have a Play Framework application that sends emails using SMTP server. Now I
Let's say I play a stereo WAV file with 317,520,000 samples, which is theoretically
I've got a Play (1.2.4) application that's working fine on my Windows 7 64bit
Update, Solved: After all this I found out that I was calling an old
Using the Play! Framework 1.2.4. I've got a nifty trait that checks an API

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.