Public Vars

Back

generic-helper-unary (clj)

(source)

function

(generic-helper-unary k args)
Clauses that accept only a single item can be implemented using this helper, as: (defn my-helper [& args] (generic-helper-unary :my-clause args)) Even though your helper is designed for clauses that accept only a single item, you should still define it as variadic, because that is the convention all helpers use here.

Examples

honeysql
(ns honey.sql.helpers-test
  (:refer-clojure :exclude [filter for group-by partition-by set update])
  (:require [clojure.test :refer [deftest is testing]]
            [honey.sql :as sql]
            [honey.sql.helpers :as h
             :refer [add-column add-index alter-table columns create-table create-table-as create-view
                     create-materialized-view drop-view drop-materialized-view
                     create-index
                     bulk-collect-into
                     cross-join do-update-set drop-column drop-index drop-table
                     filter from full-join
                     group-by having insert-into
                     join-by join lateral left-join limit offset on-conflict
                     on-duplicate-key-update
                     order-by over partition-by refresh-materialized-view
                     rename-column rename-table returning right-join
                     select select-distinct select-top select-distinct-top
                     values where window with with-columns
                     with-data within-group]]))

(defn my-update [& args] (h/generic-helper-unary    :update args))
(defn my-set    [& args] (h/generic-helper-unary    :set    args))
(defn my-where  [& args] (h/generic-helper-variadic :where  args))