clojure-demos/resources/public/documents/hiccup-sql-demo.org

21 lines
452 B
Org Mode

#+TITLE: HoneySQL tips & tricks
* Basic statements
#+BEGIN_SRC clojurescript :tangle ./src/core.cljs
#_(ns honeysql.core
(:require
[honey.sql.core :as sql]
[honey.sql.helpers :refer :all :as helpers]))
#+END_SRC
** Simple table select, with filtering and sorting applied
#+BEGIN_SRC clojurescript :tangle ./src/core.cljs
(-> (sqlh/select :*)
(sqlh/from [:company])
(sqlh/where [:= :id 1])
(sqlh/format :pretty true))
#+END_SRC