(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
(db-fn* psql)
(db-fn* psql command)
(db-fn* psql command result)
(db-fn* psql command result options)
Given parsed sql psql
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 `psql` and optionally a `command`, `result`, and `options`, return an anonymous function that can run hugsql database execute/queries and supports hugsql parameter replacement
(db-fn-map {:keys [sql hdr]} 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>} ```
(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 db
, sql
string,
param-data
, and optional command
, result
,
and options
, run the sql
statement
Given a database spec/connection `db`, `sql` string, `param-data`, and optional `command`, `result`, and `options`, run the `sql` statement
(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).
(def-db-fns-from-string s)
(def-db-fns-from-string s options)
Given a HugSQL SQL string s
, 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 statementsoptions
(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 `s`, 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.
(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`.
(def-sqlvec-fns-from-string s)
(def-sqlvec-fns-from-string s options)
Given a HugSQL SQL string s
, 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 stringoptions
(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 `s`, 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`.
(intern-db-fn pdef options)
Intern the db fn from a parsed def
Intern the db fn from a parsed def
(intern-sqlvec-fn pdef options)
Intern the sqlvec fn from a parsed def pdef
Intern the sqlvec fn from a parsed def `pdef`
(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.
(map-of-db-fns-from-string s)
(map-of-db-fns-from-string s options)
Given a HugSQL SQL string s
, 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 statementsoptions
(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 `s`, 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.
(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`.
(map-of-sqlvec-fns-from-string s)
(map-of-sqlvec-fns-from-string s options)
Given a HugSQL SQL string s
, 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 stringoptions
(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 `s`, 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`.
(set-adapter! the-adapter)
Set a global adapter.
Set a global adapter.
(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
(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
(sqlvec-fn* psql)
(sqlvec-fn* psql options)
Given parsed sql psql
and optional options
, return an
anonymous function that returns hugsql sqlvec format
Given parsed sql `psql` and optional `options`, return an anonymous function that returns hugsql sqlvec format
(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>} ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close