Archive for the ‘Scala’ Category

Public GIT repo for ScalaQuery

Saturday, February 21st, 2009

The type-safe database query library/DSL for Scala which I introduced in this post is now available in a public GIT repository at GitHub: http://github.com/szeiger/scala-query/tree

I have renamed it to ScalaQuery because SQuery and all other short names I could think of were already used by numerous other projects.

There are several changes compared to the version I used in the introduction:

  • The combinator/monad-based query classes are now in their own package com.novocode.squery.combinator.
  • The invokers (which execute a typed query through JDBC) of the combinator queries and the simple SQL queries (in com.novocode.squery.simple) have been unified.
  • Some minor renaming and refactoring.

A Type-Safe Database Query DSL for Scala

Sunday, December 21st, 2008

When the topic of JDBC wrappers came up on the Scala mailing list a few weeks ago, I mentioned that…

I’d prefer a type-safe DSL for database queries but that’s more
complicated. I’m still experimenting with that, too :)

I think those experiments worked rather well and the code is now in a state where the major features are usable and I can show some example code which compiles and runs successfully as a proof of concept. Many features (like more SQL operators, more data types and column aliasing) are missing but at least I am confident that it is possible to implement them on this basis.

Just like HaskellDB and LINQ to SQL, I am using a query monad which collects the projections and restrictions on database tables in a composable way to build an SQL statement for a query while producing the correct type for that statement’s result in Scala’s type system. Don’t worry if that sounds too abstract, there will be plenty of example code. (more…)

Formal Language Processing in Scala, Solutions to Part 4

Sunday, October 12th, 2008

Here is the solution to the exercise from part 4. (more…)

Formal Language Processing in Scala, Part 4

Saturday, September 20th, 2008

This is the fourth part in a series of articles on formal language processing in Scala, focusing on parser combinators and language interpretation. I wanted to have this part out several weeks ago but setting up my new home file server (running OpenSolaris Indiana) kept me busy. I’ll save the details of that endeavour for another post. (more…)

Formal Language Processing in Scala, Solutions to Part 3

Saturday, August 23rd, 2008

Here are the solutions to the exercises from part 3. (more…)


Close
E-mail It