Liking cljdoc? Tell your friends :D

hugsql.core


db-fn

(db-fn sql)
(db-fn sql command)
(db-fn sql command result)
(db-fn sql command result options)

Given an sql string and optionally a command, result, and options, return an anonymous function that can run hugsql database execute/queries and supports hugsql parameter replacement

Given an sql string and optionally a command, result, and options,
return an anonymous function that can run hugsql database
execute/queries and supports hugsql parameter replacement
sourceraw docstring

db-fn*

(db-fn* psql)
(db-fn* psql command)
(db-fn* psql command result)
(db-fn* psql command result options)

Given parsed sql and optionally a command, result, and options, return an anonymous function that can run hugsql database execute/queries and supports hugsql parameter replacement

Given parsed sql and optionally a command, result, and options,
return an anonymous function that can run hugsql database
execute/queries and supports hugsql parameter replacement
sourceraw docstring

db-fn-map

(db-fn-map {:keys [sql hdr file line]} options)

Hashmap of db fn from a parsed def with the form: {:fn-name {:meta {:doc "doc string"} :fn <anon-db-fn>}

Hashmap of db fn from a parsed def
with the form:
{:fn-name {:meta {:doc "doc string"}
           :fn <anon-db-fn>}
sourceraw docstring

db-run

(db-run db sql)
(db-run db sql param-data)
(db-run db sql param-data command)
(db-run db sql param-data command result)
(db-run db sql param-data command result options & command-options)

Given a database spec/connection, sql string, parameter data, and optional command, result, and options, run the sql statement

Given a database spec/connection, sql string,
parameter data, and optional command, result,
and options, run the sql statement
sourceraw docstring

def-db-fnsmacro

(def-db-fns file)
(def-db-fns file options)

Given a HugSQL SQL file, define the database functions in the current namespace.

Usage:

(def-db-fns file options?)

where:

  • file is a string file path in your classpath, a resource object (java.net.URL), or a file object (java.io.File)
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :adapter adapter }

:quoting options for identifiers are: :ansi double-quotes: "identifier" :mysql backticks: identifier :mssql square brackets: [identifier] :off no quoting (default)

Identifiers containing a period/dot . are split, quoted separately, and then rejoined. This supports myschema.mytable conventions.

:quoting can be overridden as an option in the calls to functions created by def-db-fns.

:adapter specifies the HugSQL adapter to use for all defined functions. The default adapter used is (hugsql.adapter.clojure-java-jdbc/hugsql-adapter-clojure-java-jdbc) when :adapter is not given.

See also hugsql.core/set-adapter! to set adapter for all def-db-fns calls. Also, :adapter can be specified for individual function calls (overriding set-adapter! and the :adapter option here).

Given a HugSQL SQL file, define the database
functions in the current namespace.

Usage:

(def-db-fns file options?)

where:
 - file is a string file path in your classpath,
   a resource object (java.net.URL),
   or a file object (java.io.File)
 - options (optional) hashmap:
   {:quoting :off(default) | :ansi | :mysql | :mssql
    :adapter adapter }

:quoting options for identifiers are:
  :ansi double-quotes: "identifier"
  :mysql backticks: `identifier`
  :mssql square brackets: [identifier]
  :off no quoting (default)

Identifiers containing a period/dot . are split, quoted separately,
and then rejoined. This supports myschema.mytable conventions.

:quoting can be overridden as an option in the calls to functions
created by def-db-fns.

:adapter specifies the HugSQL adapter to use for all defined
functions. The default adapter used is
(hugsql.adapter.clojure-java-jdbc/hugsql-adapter-clojure-java-jdbc)
when :adapter is not given.

See also hugsql.core/set-adapter! to set adapter for all def-db-fns
calls.  Also, :adapter can be specified for individual function
calls (overriding set-adapter! and the :adapter option here).
sourceraw docstring

def-db-fns-from-stringmacro

(def-db-fns-from-string s)
(def-db-fns-from-string s options)

Given a HugSQL SQL string, define the database functions in the current namespace.

Usage:

(def-db-fns-from-string s options?)

where:

  • s is a string of HugSQL-flavored sql statements
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.

Given a HugSQL SQL string, define the database
functions in the current namespace.

Usage:

(def-db-fns-from-string s options?)

where:
 - s is a string of HugSQL-flavored sql statements
 - options (optional) hashmap:
   {:quoting :off(default) | :ansi | :mysql | :mssql
    :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.
sourceraw docstring

def-sqlvec-fnsmacro

(def-sqlvec-fns file)
(def-sqlvec-fns file options)

Given a HugSQL SQL file, define the <name>-sqlvec functions in the current namespace. Returns sqlvec format: a vector of SQL and parameter values. (e.g., ["select * from test where id = ?" 42])

Usage:

(def-sqlvec-fns file options?)

where:

  • file is a string file path in your classpath, a resource object (java.net.URL), or a file object (java.io.File)
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :fn-suffix "-sqlvec" (default)

See hugsql.core/def-db-fns for :quoting option details.

:fn-suffix is appended to the defined function names to differentiate them from the functions defined by def-db-fns.

Given a HugSQL SQL file, define the <name>-sqlvec functions in the
current namespace.  Returns sqlvec format: a vector of SQL and
parameter values. (e.g., ["select * from test where id = ?" 42])

Usage:

 (def-sqlvec-fns file options?)

 where:
  - file is a string file path in your classpath,
    a resource object (java.net.URL),
    or a file object (java.io.File)
  - options (optional) hashmap:
    {:quoting :off(default) | :ansi | :mysql | :mssql
     :fn-suffix "-sqlvec" (default)

 See hugsql.core/def-db-fns for :quoting option details.

 :fn-suffix is appended to the defined function names to
 differentiate them from the functions defined by def-db-fns.
sourceraw docstring

def-sqlvec-fns-from-stringmacro

(def-sqlvec-fns-from-string s)
(def-sqlvec-fns-from-string s options)

Given a HugSQL SQL string, define the <name>-sqlvec functions in the current namespace. Returns sqlvec format: a vector of SQL and parameter values. (e.g., ["select * from test where id = ?" 42])

Usage:

(def-sqlvec-fns-from-string s options?)

where:

  • s is a HugSQL-flavored sql string
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :fn-suffix "-sqlvec" (default)

See hugsql.core/def-db-fns for :quoting option details.

:fn-suffix is appended to the defined function names to differentiate them from the functions defined by def-db-fns.

Given a HugSQL SQL string, define the <name>-sqlvec functions in the
current namespace.  Returns sqlvec format: a vector of SQL and
parameter values. (e.g., ["select * from test where id = ?" 42])

Usage:

 (def-sqlvec-fns-from-string s options?)

 where:
  - s is a HugSQL-flavored sql string
  - options (optional) hashmap:
    {:quoting :off(default) | :ansi | :mysql | :mssql
     :fn-suffix "-sqlvec" (default)

 See hugsql.core/def-db-fns for :quoting option details.

 :fn-suffix is appended to the defined function names to
 differentiate them from the functions defined by def-db-fns.
sourceraw docstring

default-db-options

source

default-sqlvec-options

source

hugsql-command-fnmultimethod

source

hugsql-result-fnmultimethod

source

intern-db-fn

(intern-db-fn pdef options)

Intern the db fn from a parsed def

Intern the db fn from a parsed def
sourceraw docstring

intern-sqlvec-fn

(intern-sqlvec-fn pdef options)

Intern the sqlvec fn from a parsed def

Intern the sqlvec fn from a parsed def
sourceraw docstring

map-of-db-fnsmacro

(map-of-db-fns file)
(map-of-db-fns file options)

Given a HugSQL SQL file, return a hashmap of database functions of the form:

{:fn1-name {:meta {:doc "doc string"} :fn <fn1>} :fn2-name {:meta {:doc "doc string" :private true} :fn <fn2>}}

Usage:

(map-of-db-fns file options?)

where:

  • file is a string file path in your classpath, a resource object (java.net.URL), or a file object (java.io.File)
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.

Given a HugSQL SQL file, return a hashmap of database
functions of the form:

{:fn1-name {:meta {:doc "doc string"}
            :fn <fn1>}
 :fn2-name {:meta {:doc "doc string"
                   :private true}
            :fn <fn2>}}

Usage:

(map-of-db-fns file options?)

where:
 - file is a string file path in your classpath,
   a resource object (java.net.URL),
   or a file object (java.io.File)
 - options (optional) hashmap:
   {:quoting :off(default) | :ansi | :mysql | :mssql
    :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.
sourceraw docstring

map-of-db-fns-from-stringmacro

(map-of-db-fns-from-string s)
(map-of-db-fns-from-string s options)

Given a HugSQL SQL string, return a hashmap of database functions of the form:

{:fn1-name {:meta {:doc "doc string"} :fn <fn1>} :fn2-name {:meta {:doc "doc string" :private true} :fn <fn2>}}

Usage:

(map-of-db-fns-from-string s options?)

where:

  • s is a string of HugSQL-flavored sql statements
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.

Given a HugSQL SQL string, return a hashmap of database
functions of the form:

{:fn1-name {:meta {:doc "doc string"}
            :fn <fn1>}
 :fn2-name {:meta {:doc "doc string"
                   :private true}
            :fn <fn2>}}

Usage:

(map-of-db-fns-from-string s options?)

where:
 - s is a string of HugSQL-flavored sql statements
 - options (optional) hashmap:
   {:quoting :off(default) | :ansi | :mysql | :mssql
    :adapter adapter }

See hugsql.core/def-db-fns for :quoting and :adapter details.
sourceraw docstring

map-of-sqlvec-fnsmacro

(map-of-sqlvec-fns file)
(map-of-sqlvec-fns file options)

Given a HugSQL SQL file, return a hashmap of database functions of the form:

{:fn1-name {:meta {:doc "doc string"} :fn <fn1>} :fn2-name {:meta {:doc "doc string" :private true} :fn <fn2>}}

Usage:

(map-sqlvec-fns file options?)

where:

  • file is a string file path in your classpath, a resource object (java.net.URL), or a file object (java.io.File)
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :fn-suffix "-sqlvec" (default)

See hugsql.core/def-db-fns for :quoting option details.

:fn-suffix is appended to the defined function names to differentiate them from the functions defined by def-db-fns.

Given a HugSQL SQL file, return a hashmap of database
 functions of the form:

 {:fn1-name {:meta {:doc "doc string"}
             :fn <fn1>}
  :fn2-name {:meta {:doc "doc string"
                    :private true}
             :fn <fn2>}}

Usage:

 (map-sqlvec-fns file options?)

 where:
  - file is a string file path in your classpath,
    a resource object (java.net.URL),
    or a file object (java.io.File)
  - options (optional) hashmap:
    {:quoting :off(default) | :ansi | :mysql | :mssql
     :fn-suffix "-sqlvec" (default)

 See hugsql.core/def-db-fns for :quoting option details.

 :fn-suffix is appended to the defined function names to
 differentiate them from the functions defined by def-db-fns.
sourceraw docstring

map-of-sqlvec-fns-from-stringmacro

(map-of-sqlvec-fns-from-string s)
(map-of-sqlvec-fns-from-string s options)

Given a HugSQL SQL string, return a hashmap of sqlvec functions of the form:

{:fn1-name {:meta {:doc "doc string"} :fn <fn1>} :fn2-name {:meta {:doc "doc string" :private true} :fn <fn2>}}

Usage:

(map-sqlvec-fns-from-string s options?)

where:

  • s is a HugSQL-flavored sql string
  • options (optional) hashmap: {:quoting :off(default) | :ansi | :mysql | :mssql :fn-suffix "-sqlvec" (default)

See hugsql.core/def-db-fns for :quoting option details.

:fn-suffix is appended to the defined function names to differentiate them from the functions defined by def-db-fns.

Given a HugSQL SQL string, return a hashmap of sqlvec
 functions of the form:

 {:fn1-name {:meta {:doc "doc string"}
             :fn <fn1>}
  :fn2-name {:meta {:doc "doc string"
                    :private true}
             :fn <fn2>}}

Usage:

 (map-sqlvec-fns-from-string s options?)

 where:
  - s is a HugSQL-flavored sql string
  - options (optional) hashmap:
    {:quoting :off(default) | :ansi | :mysql | :mssql
     :fn-suffix "-sqlvec" (default)

 See hugsql.core/def-db-fns for :quoting option details.

 :fn-suffix is appended to the defined function names to
 differentiate them from the functions defined by def-db-fns.
sourceraw docstring

set-adapter!

(set-adapter! the-adapter)

Set a global adapter.

Set a global adapter.
sourceraw docstring

snip

Alias for sqlvec

Alias for sqlvec
sourceraw docstring

snip-fn

Alias for sqlvec-fn

Alias for sqlvec-fn
sourceraw docstring

sqlvec

(sqlvec sql param-data)
(sqlvec sql options param-data)

Given an sql string, optional options, and param data, return an sqlvec

Given an sql string, optional options, and param data, return an sqlvec
sourceraw docstring

sqlvec-fn

(sqlvec-fn sql)
(sqlvec-fn sql options)

Given an sql string and optional options, return an anonymous function that returns hugsql sqlvec format

Given an sql string and optional options, return an
anonymous function that returns hugsql sqlvec format
sourceraw docstring

sqlvec-fn*

(sqlvec-fn* psql)
(sqlvec-fn* psql options)

Given parsed sql and optional options, return an anonymous function that returns hugsql sqlvec format

Given parsed sql and optional options, return an
anonymous function that returns hugsql sqlvec format
sourceraw docstring

sqlvec-fn-map

(sqlvec-fn-map {:keys [sql hdr]} options)

Hashmap of sqlvec/snip fn from a parsed def with the form: {:fn-name {:meta {:doc "doc string"} :fn <anon-db-fn>}

Hashmap of sqlvec/snip fn from a parsed def
with the form:
{:fn-name {:meta {:doc "doc string"}
           :fn <anon-db-fn>}
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close