Daniel will introduce the Datomic database system, discuss how it differentiates itself from other Database systems and demonstrate its usage. This will cover schema creation, entity transaction, Datalog queries and the different APIs that are available for interacting with Datomic.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def my-state (atom {:foo {:bar [1 2 3]}})) | |
@my-state | |
;; {:foo {:bar [1 2 3]}} | |
(swap! my-state update-in [:foo :bar] #(conj % 4)) | |
;; {:foo {:bar [1 2 3 4]}} | |
@my-state | |
;; {:foo {:bar [1 2 3 4]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns log-test | |
(:import | |
[ch.qos.logback.classic Level] | |
[org.slf4j LoggerFactory Logger])) | |
(defn set-log-level | |
[logger level] | |
(.setLevel logger level)) | |
(defn root-logger [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"/user" {:get #vase/query {:name :your-first-api.v1/user-page | |
;; Params are required if they don't have defaults | |
:params [identifier] | |
:edn-coerce [identifier] | |
:query [:find (pull ?e [*]) | |
:in $ ?identifier | |
:where | |
(or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns terminator.service | |
(:require [io.pedestal.http :as http] | |
[io.pedestal.http.route :as route] | |
[io.pedestal.http.body-params :as body-params] | |
[io.pedestal.interceptor :as i] | |
[ring.util.response :as ring-resp])) | |
(defn about-page | |
[request] | |
(ring-resp/response (format "Clojure %s - served from %s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[io.pedestal.http.route :as route]) | |
;; The following examples use a contrived expanded route structure. You can test your routes | |
;; by using the result of `(route/expand-routes my-routes)`, where `my-routes` is your route representation | |
;; created using one of the supported route syntaxes. If you are using the `pedestal-service` lein template, | |
;; you would use `(route/expand-routes service/routes)`. | |
(def contrived-expanded-routes [{:path "/bar" :method :get :interceptors []}]) | |
;; You can test route matching with `try-routing-for` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.service | |
(:require [io.pedestal.http :as http] | |
[clojure.core.async :as async] | |
[io.pedestal.http.route :as route] | |
[io.pedestal.interceptor :as i] | |
[io.pedestal.http.body-params :as body-params] | |
[ring.util.response :as ring-resp])) | |
(defn about-page | |
[request] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[io.pedestal.http.route.path :as route.path]) | |
(require '[io.pedestal.http.route :as route]) | |
(require '[io.pedestal.http.route.map-tree :as route.map-tree]) | |
(require '[io.pedestal.http.route.router :as route.router]) | |
;; handler fns and common-interceptors elided | |
(def routes #{["/" :get (conj common-interceptors `home-page)] | |
["/about" :get (conj common-interceptors `about-page)] | |
["/foo/:id" :get (conj common-interceptors `foo)]}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns session.service | |
(:require [io.pedestal.http :as http] | |
[io.pedestal.http.route :as route] | |
[io.pedestal.http.body-params :as body-params] | |
[ring.util.response :as ring-resp])) | |
(defn about-page | |
[request] | |
(ring-resp/response (format "Clojure %s - served from %s" | |
(clojure-version) |
OlderNewer