Entity-db provides a JSON API to manage database schema and perform CRUD operations on entities. It is written in Clojure on top of
- Datomic - it's a NoSQL database with very rich modelling/querying capabilities
- Compojure - a minimalistic web routing library for JSON Web API
- Ring - Web server interface library (similar to Rack
$ brew install leiningen
$ lein install
To run the server at localhost:3000
$ lein ring server-headless
$ lein test
curl -X POST -d '{"dbname": "nuh-development"}' -H "Content-Type: application/json" localhost:3000/dbs
curl localhost:3000/testing/entities
curl -X DELETE localhost:3000/dbs/nuh-development
Create entity attribute customer/name in the "test" db (this also creates an entity the first time it is used)
curl -X POST -d '{"attr":{"name": "name", "description": "Customer name"}}' -H "Content-Type: application/json" localhost:3000/test/entities/customer/attrs
curl -X POST -d '{"attr":{"name": "age", "description": "Customer age", "type": "long"}}' -H "Content-Type: application/json" localhost:3000/test/entities/customer/attrs
curl -X POST -d '{"attrs":{"customer/name": "Karol Hosiawa", "customer/age": 35}}' -H "Content-Type: application/json" localhost:3000/test/entities/customer
curl -X POST -d '{"attrs":{"customer/name": "Paul Syrysko", "customer/age": 49}}' -H "Content-Type: application/json" localhost:3000/test/entities/customer
curl localhost:3000/test/entities/customer
...
Karol Hosiawa hosiawak@gmail.com
Copyright © 2015 Propheris
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.