Liking cljdoc? Tell your friends :D

metabase.util.honeysql


*clj

(* & exprs)

Math operator. Interpose * between exprs and wrap in parentheses.

Math operator. Interpose `*` between `exprs` and wrap in parentheses.
sourceraw docstring

+clj

(+ & exprs)

Math operator. Interpose + between exprs and wrap in parentheses.

Math operator. Interpose `+` between `exprs` and wrap in parentheses.
sourceraw docstring

-clj

(- & exprs)

Math operator. Interpose - between exprs and wrap in parentheses.

Math operator. Interpose `-` between `exprs` and wrap in parentheses.
sourceraw docstring

->booleanclj

(->boolean x)

CAST x to a boolean datatype

CAST `x` to a `boolean` datatype
sourceraw docstring

->dateclj

(->date x)

CAST x to a date.

CAST `x` to a `date`.
sourceraw docstring

->datetimeclj

(->datetime x)

CAST x to a datetime.

CAST `x` to a `datetime`.
sourceraw docstring

->integerclj

(->integer x)

CAST x to a integer.

CAST `x` to a `integer`.
sourceraw docstring

->timeclj

(->time x)

CAST x to a time datatype

CAST `x` to a `time` datatype
sourceraw docstring

->timestampclj

(->timestamp x)

CAST x to a timestamp.

CAST `x` to a `timestamp`.
sourceraw docstring

->timestamp-with-time-zoneclj

(->timestamp-with-time-zone x)

CAST x to a timestamp with time zone.

CAST `x` to a `timestamp with time zone`.
sourceraw docstring

/clj

(/ & exprs)

Math operator. Interpose / between exprs and wrap in parentheses.

Math operator. Interpose `/` between `exprs` and wrap in parentheses.
sourceraw docstring

castclj

(cast c x)

Generate a statement like cast(x AS c).

Generate a statement like `cast(x AS c)`.
sourceraw docstring

concatclj

(concat & exprs)

SQL concat function.

SQL `concat` function.
sourceraw docstring

dayclj

(day & exprs)

SQL day function.

SQL `day` function.
sourceraw docstring

decclj

(dec x)

Subtract 1 from x.

Subtract 1 from `x`.
sourceraw docstring

floorclj

(floor & exprs)

SQL floor function.

SQL `floor` function.
sourceraw docstring

formatclj

(format format-str expr)

SQL format function.

SQL `format` function.
sourceraw docstring

hourclj

(hour & exprs)

SQL hour function.

SQL `hour` function.
sourceraw docstring

identifierclj

(identifier identifier-type & components)

Inputs: [identifier-type :- IdentifierType & components] Returns: Identifier

Define an identifer of type with components. Prefer this to using keywords for identifiers, as those do not properly handle identifiers with slashes in them.

identifier-type represents the type of identifier in question, which is important context for some drivers, such as BigQuery (which needs to qualify Tables identifiers with their dataset name.)

This function automatically unnests any Identifiers passed as arguments, removes nils, and converts all args to strings.

Inputs: [identifier-type :- IdentifierType & components]
Returns: Identifier

Define an identifer of type with `components`. Prefer this to using keywords for identifiers, as those do not
properly handle identifiers with slashes in them.

`identifier-type` represents the type of identifier in question, which is important context for some drivers, such
as BigQuery (which needs to qualify Tables identifiers with their dataset name.)

This function automatically unnests any Identifiers passed as arguments, removes nils, and converts all args to
strings.
sourceraw docstring

IdentifierTypeclj

Schema for valid Identifier types.

Schema for valid Identifier types.
sourceraw docstring

incclj

(inc x)

Add 1 to x.

Add 1 to `x`.
sourceraw docstring

literalclj

(literal s)

Wrap keyword or string s in single quotes and a HoneySQL raw form.

We'll try to escape single quotes in the literal, unless they're already escaped (either as '' or as \, but this won't handle wacky cases like three single quotes in a row. Don't use literal for things that might be wacky. Only use it for things that are hardcoded.

Wrap keyword or string `s` in single quotes and a HoneySQL `raw` form.

We'll try to escape single quotes in the literal, unless they're already escaped (either as `''` or as `\`, but
this won't handle wacky cases like three single quotes in a row. Don't use `literal` for things that might be wacky.
Only use it for things that are hardcoded.
sourceraw docstring

minuteclj

(minute & exprs)

SQL minute function.

SQL `minute` function.
sourceraw docstring

modclj

(mod & exprs)

Math operator. Interpose % between exprs and wrap in parentheses.

Math operator. Interpose `%` between `exprs` and wrap in parentheses.
sourceraw docstring

monthclj

(month & exprs)

SQL month function.

SQL `month` function.
sourceraw docstring

quarterclj

(quarter & exprs)

SQL quarter function.

SQL `quarter` function.
sourceraw docstring

quoted-castclj

(quoted-cast c x)

Generate a statement like cast(x AS "c").

Like cast but quotes the type C. This is useful for cases where we deal with user-defined types or other types that may have a space in the name, for example Postgres enum types.

Generate a statement like `cast(x AS "c")`.

Like `cast` but quotes the type C. This is useful for cases where we deal with user-defined types or other types
that may have a space in the name, for example Postgres enum types.
sourceraw docstring

roundclj

(round x decimal-places)

SQL round function.

SQL `round` function.
sourceraw docstring

weekclj

(week & exprs)

SQL week function.

SQL `week` function.
sourceraw docstring

yearclj

(year & exprs)

SQL year function.

SQL `year` function.
sourceraw docstring

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

× close