Extending the set of field type in Squeryl (ex. JodaTime)

180 views
Skip to first unread message

Maxime Lévesque

unread,
Dec 13, 2011, 12:30:17 PM12/13/11
to Squeryl

There's been quite an overhaul of how the AST lifting is done in Squeryl, it's happening in this branch :

  https://github.com/max-l/Squeryl/tree/AST-lifting-overhaul

the result is quite pleasing, for it looks much nicer under the hood, which was a strong motivation for the change.
But the primary motivation was to make it easy to extend the set of field types supported by Squeryl.

Today one could not persist a class such as this one :

  class My(val url: URL, val myJodaTime: DateTime, val aFile: File)

With the mentioned changes, it will be possible.
Here is an example of how one would add support for JodaTime :

  https://github.com/max-l/squeryl-extended-field-types-example/blob/master/src/main/scala/example/MyCustomTypes.scala

the same recipe can be used for adding support for an arbitrary type, provided that it can be converted to and from a native JDBC column type

This will likely go in version 0.9.6, because in this version I would also like to change the way bootstraping is
currently done, I'm not too satisfied with SessionFactory, I will further discussed the envisioned changess,
but there are chances that backward compatibility gets broken, althougn it's possible to make this a
deprecation warning for a smother phase out. More on this later.
So the next release (0.9.5) will happen pretty soon, and will likely be the current state of the master branch
with a few bug fixes.

Cheers

ML

Max

unread,
Jun 24, 2012, 5:52:34 PM6/24/12
to squ...@googlegroups.com

The code is is master, 

also in the maven repo as :  0.9.6-SNAPSHOT

Cheers

On Saturday, June 23, 2012 10:55:57 PM UTC-4, Carlos Quiroz wrote:
Hi Max

I'd love to store JodaTime objects using squeryl

Is this going to be in the next release? Is in the master already?

Carlos
Reply all
Reply to author
Forward
0 new messages