Skip to content

Instantly share code, notes, and snippets.

Avatar

Stuart Halloway stuarthalloway

View GitHub Profile
@stuarthalloway
stuarthalloway / gist:3068749
Created Jul 8, 2012 — forked from cs224/gist:3066392
datomic-clojure-relational-algebra-2012-07-07
View gist:3068749
;; Datomic example code
;; Demonstrates using datalog with Clojure defrecords
(use '[datomic.api :only [q db] :as d])
;;; http://www.lshift.net/blog/2010/08/21/some-relational-algebra-with-datatypes-in-clojure-12
(defrecord Supplier [number name status city])
(defrecord Part [number name colour weight city])
(defrecord Shipment [supplier part quantity])
;; sample data