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

452 B

HoneySQL tips & tricks

Basic statements

#_(ns honeysql.core
  (:require
   [honey.sql.core :as sql]
   [honey.sql.helpers :refer :all :as helpers]))

Simple table select, with filtering and sorting applied

(-> (sqlh/select :*)
    (sqlh/from [:company])
    (sqlh/where [:= :id 1])
    (sqlh/format :pretty true))