Liking cljdoc? Tell your friends :D

org.purefn.sqlium.sql


alias-columnclj

(alias-column table-name column)

Returns a column alias from a table and column name, for deterministic control of query results.

Returns a column alias from a table and column name, for
deterministic control of query results.
raw docstring

aliased-fields-statementclj

(aliased-fields-statement alias-map)

Takes a map of :aliased-query-column-name to :table/column and returns a SQL fields statement, eg "SELECT <fields> FROM ..."

Takes a map of `:aliased-query-column-name` to `:table/column` and
returns a SQL fields statement, eg "SELECT <fields> FROM ..."
raw docstring

column-mappingsclj

(column-mappings table)

Returns a map of :aliased-query-column-name to :table/column from a table spec.

Returns a map of `:aliased-query-column-name` to `:table/column`
from a table spec.
raw docstring

column-nameclj

(column-name kw)

Returns the column name from a keyword.

Returns the column name from a keyword.
raw docstring

condition-sqlclj

(condition-sql condition)
(condition-sql condition table-alias)

Takes a condition map, and optional table alias for the column's table, and returns a SQL condition string fragment. Default comparator is "=".

Eg, {:column :foo/bar :comparator ">" :value 5}

Becomes "foo.bar > 5"

Takes a condition map, and optional table alias for the column's
table, and returns a SQL condition string fragment. Default
comparator is "=".

Eg, `{:column :foo/bar
      :comparator ">"
      :value 5}`

Becomes "foo.bar > 5"
raw docstring

dependency-orderedclj

(dependency-ordered root-table rels)

Takes a collection of relationships and the root table, and returns the relationships in a dependency-satisfied order.

Takes a collection of relationships and the root table, and returns
the relationships in a dependency-satisfied order.
raw docstring

field-columnclj

(field-column field)

Returns column name from a field as string.

Returns column name from a field as string.
raw docstring

field-split-strclj


from-statementclj

(from-statement table)
(from-statement table recurse?)

Builds a from statement from table spec. Optionally, recurses through the many relationships and adds them to the statement.

Builds a from statement from table spec. Optionally, recurses
through the many relationships and adds them to the statement.
raw docstring

group-column-mappingsclj

(group-column-mappings table)

Returns a map of :aliased-query-column to :table/column for all the columns in a table spec's query group (itself and its single relationships.)

Returns a map of `:aliased-query-column` to `:table/column` for all
the columns in a table spec's query group (itself and its single
relationships.)
raw docstring

in-statementclj

(in-statement {:keys [field vals] :as in})

Returns an IN statement that can be used in a WHERE clause to match a column against a set of values.

Returns an IN statement that can be used in a WHERE clause to match
a column against a set of values.
raw docstring

inner-join-sqlclj

(inner-join-sql join)

Takes a join map and returns SQL fragment for an inner join. Join map has :base and :target keys, each of which are maps of:

  • :name table name string
  • :alias optional table alias string
  • :join-col string name of the join column
Takes a join map and returns SQL fragment for an inner join.
Join map has :base and :target keys, each of which are maps of:

* :name      table name string
* :alias     optional table alias string
* :join-col  string name of the join column
raw docstring

many-relationship-selectclj

(many-relationship-select rel data)

Takes a many relationship and data returned from the parent query and builds a query to select the many relationship data. Returns tuple of [sql-query column-alias-map].

Takes a many relationship and data returned from the parent query
and builds a query to select the many relationship data. Returns tuple of [sql-query column-alias-map].
raw docstring

mysql-date-stringclj

(mysql-date-string date)

Takes a date coerceable to LocalDateTime, and returns mysql-formatted date time string.

Takes a date coerceable to LocalDateTime, and returns mysql-formatted
date time string.
raw docstring

prefixed-columnclj

(prefixed-column table column)

Returns a prefixed column from a table name and column name, for use in SQL statements.

Returns a prefixed column from a table name and column name, for
use in SQL statements.
raw docstring

selectclj

(select table)

Builds select statement from table. Optionally, brings in levels of many relationships in the from statement to use for filtering. Returns tuple of [sql-query column-alias-map].

Builds select statement from table. Optionally, brings in levels of
many relationships in the from statement to use for filtering.
Returns tuple of [sql-query column-alias-map].
raw docstring

with-limitclj

(with-limit query limit)
(with-limit query limit offset)

Adds a limit and optionally an offset to query string.

Adds a limit and optionally an offset to query string.
raw docstring

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

× close