This library is a Clojure wrapper for Google App Engine. It is based on John Hume's appengine-clj with some enhancements. It is heavily refactored, so don't expect any backwards compatibility with the original library.
The Autodoc generated API documentation can be found here.
The easiest way to use this library in your own projects is via Leiningen. Add the following dependency to your project.clj file:
[appengine "0.4.3-SNAPSHOT"]
At the moment not all App Engine JARs are available through the public Maven repositories (or I couldn't find them). Running the following command downloads and installs all required JARs into your local Maven repository ...
./bin/install-appengine-jars.sh
To build from source, run the following commands:
lein deps
lein jar
; Use the datastore api.
(use 'appengine.datastore)
; Define some entities.
(defentity Continent ()
((iso-3166-alpha-2 :key clojure.contrib.string/lower-case)
(location :serialize com.google.appengine.api.datastore.GeoPt)
(name)))
(defentity Country (Continent)
((iso-3166-alpha-2 :key clojure.contrib.string/lower-case)
(location :serialize com.google.appengine.api.datastore.GeoPt)
(name)))
; Initialize the environment for the repl.
(appengine.environment/init-repl)
; Make a continent record.
(def *europe* (continent {:iso-3166-alpha-2 "eu" :name "Europe" :location {:latitude 1 :longitude 2}}))
; Make a country record (a country must have a continent as it's parent).
(def *germany* (country *europe* {:iso-3166-alpha-2 "de" :name "Germany" :location {:latitude 1 :longitude 2}}))
; Find a contient (returns nil, because the continent has not been saved yet).
(find-entity *europe*)
; Save the continent to the datastore.
(save-entity *europe*)
; Find all continents.
(find-continents "Europe")
; Find all continents by name.
(find-continents-by-name "Europe")
; Delete the entity from the datastore.
(delete-entity *europe*)
Take a look at the documentation or browse the test directory for more examples.