implicit.ly

Scala software, hot off the presses

highchair 0.0.4

New Query DSL

Version 0.0.4 introduces a new query DSL which intentionally resembles the excellent rogue DSL. The DSL has always been type-safe, but the new DSL more closely resembles the structure of a query while enabling you to store queries (or base queries) for reuse. Queries now look like this:

Person where (_.name is "Martin")
  and (_.lastName in ("Odersky", "Jones"))
  orderDesc (_.age)

New Features in Datastore

  • New query DSL based on the excellent rogue DSL
  • Support for mapping Joda DateTime and Google BlobKey properties
  • Query support for limits, offsets, and efficient keys-only queries
  • Connection object as a convenience for implicit DatastoreService instances

Breaking Changes

Now that highchair is no longer focused only on the datastore, packages have been restructured to better support multiple modules. This means prior code won't work. If you are using highchair and such changes have troublesome effects on your project, bug me on the list and I'll be inclined to listen.

highchair is a set of modules for developing Google App Engine services and applications in scala.

  • highchair-datastore provides a simple mapper and type-safe query DSL for working with the google datastore
  • highchair-remote provides a remote construct for interacting GAE applications

Filed under  //   Scala 2.8.0   Scala 2.8.1   Scala 2.9.0   Scala 2.9.0-1   highchair   net.thegodcode  

highchair 0.0.3

Breaking Changes

  • Kind#newKey has been removed as it relied on a hack that fails locally in current versions of the sdk

Highchair Remote

As of Google App Engine SDK version 1.4.3, it is possible to interface with App Engine services from any application through the Remote API. With highchair remote you can bind to a remote applicaiton by providing the application id and the credentials of an admin user for that application.

val remote = Remote("localhost" -> 8080, "user@foo.com" -> "foopass")

With a Remote instance, you can interact with various App Engine services through blocks scoped to a remote application.

remote {
  val ds = DatastoreServiceFactory.getDatastoreService
  ds.put(new Entity("RemoteEntity"))
}

Remote blocks are scoped such that when then block terminates, subsequent service calls will resume local bindings.

See the wiki page page for more information.

Highchair Util and Spec

The util module provides a single useful tool, DevServer, which provides basic control over a local GAE dev server. If you have defined the APPENGINE_SDK_HOME environment variable, the following is enough to obtain a DevServer instance:

val server = DevServer()

With a DevServer, you can quickly start and deploy an app:

server.start(pathToWar)

The spec module now contains a new base spec for integration tests against a local app. By providing the path to the war directory, AppSepc manages the startup and shutdown of the application under test. All you have to do is provide the war path and the specs:

class MyGAESpec extends highchair.specs.AppSpec { /* specs here */ }

highchair is a library for persisting scala objects to the Google Datastore.

Filed under  //   Scala 2.8.0   Scala 2.8.1   Scala 2.9.0   highchair   net.thegodcode  

highchair 0.0.2

Queries

Queries are now represented by Query instances. Kind#find receives a Query instance instead of a list of filters. Filters are added to a query by the and (&&) operation.

Person find {
  Person.firstName === "Chris" && Person.lastName === "Lewis"
}

Implicit conversions exist for converting properties to property filters as well as property filters to queries, so the following query works as expected:

Person find { Person.lastName === "Lewis" }

Features

  • && operations for a more natural query syntax
  • Sortable queries via Query#sort (see specs)
  • Cross-compilation for Scala 2.8.0 and 2.8.1
  • Tested against GAE artifacts 1.3.7, 1.3.8, 1.4.0.
  • [philcali] Added support for appengine Text datastore type (see specs)

Fixes

  • Sort operations work

highchair is a library for persisting scala objects to the Google Datastore.

Filed under  //   Scala 2.8.0   Scala 2.8.1   highchair   net.thegodcode  

highchair 0.0.1

Simple Persistence for Scala in Google App Engine

It is possible to use JPA, JDO, or even the low-level API to handle persistence to Google App Engine's Datastore from scala. However, none of these are nice to use, especially from scala (xml + annotations + java collections = blah). Highchair aims to provide an idiomatic and natural API for persisting scala objects to the datastore.

This is a young library, so feedback is most welcome. Highchair is currently in use in the reference application lssn.me, a minimal URL shortner deployed to Google App Engine (source).

Features

  • Type-safe query DSL.
  • Focus on immutability. Entity => object instantiation is done via constructors, so case classes are a natrual choice.
  • Easy to setup and use.
  • Test harness to run data bound tests via specs.

highchair is a library for persisting scala objects to the Google Datastore.

Filed under  //   Scala 2.8.0   Scala 2.8.1   godcode   highchair