January 2018
Intermediate to advanced
336 pages
7h 56m
English
To connect to a database, first, define the database URI and create a database using the create-database function of the datomic.api namespace. It takes as input a database URI that defines the storage engine to be used, that is, mem for in-memory and the database to be created, that is, hhorder for Helping Hands orders. It returns true if the database is created successfully as shown here:
pedestal-play.server> (require '[datomic.api :as d])nilpedestal-play.server> (def dburi "datomic:mem://hhorder")#'pedestal-play.server/dburipedestal-play.server> (d/create-database dburi)truepedestal-play.server>
Once the database is created, connect to it using the connect function provided by the datomic.api namespace. It returns ...
Read now
Unlock full access