Back

as-keys (clj)

(source)

function

(as-keys key-map opts)
Given a hash map of column names and values, return a string of all the column names. Applies any `:column-fn` supplied in the options.

Examples

next-jdbc
(ns next.jdbc.sql.builder-test
  "Tests for the SQL string building functions in next.jdbc.sql.builder."
  (:require [clojure.test :refer [deftest is testing]]
            [next.jdbc.quoted :refer [mysql sql-server]]
            [next.jdbc.sql.builder :as builder]))

(deftest test-as-keys
  (is (= (builder/as-keys {:a nil :b 42 :c "s"} {})
         "a, b, c")))
seancorfield/next-jdbc
(ns next.jdbc.sql.builder-test
  "Tests for the SQL string building functions in next.jdbc.sql.builder."
  (:require [clojure.test :refer [deftest is testing]]
            [next.jdbc.quoted :refer [mysql sql-server]]
            [next.jdbc.sql.builder :as builder]))

(deftest test-as-keys
  (is (= (builder/as-keys {:a nil :b 42 :c "s"} {})
         "a, b, c")))