com.borkdal.squirrel.postgresql

add

multimethod

Adds a sub-entity to an entity, using record-type for dispatch:

(compile-sql
 (add
  (select (table-expression (table-name "t")))
  (column (value-expression "c"))))
  => "select c from t"

If a sequence is provided, the sequence entities will be added separately:

(compile-sql
 (add
  (select (table-expression (table-name "t")))
  [(column (value-expression "c1"))
   (column (value-expression "c2"))]))
  => "select c1, c2 from t"

Can also be used as a reducer:

(compile-sql
 (reduce add
         (select (table-expression (table-name "t")))
         [(column (value-expression "c1"))
          (column (value-expression "c2"))
          (column (value-expression "c3"))]))
  => "select c1, c2, c3 from t"

(Examples are using com.borkdal.squirrel.postgresql.language.)

all

(all)

Function for creating an entity of type All.

It has no sub-entities.

For instance,

(all)

all?

(all? entity)

Check if entity is of type All.

and-condition

(and-condition & rest)

Function for creating an entity of type AndCondition.

It accepts (a subset of) the following sub-entities:

For instance,

(and-condition (condition ...))

and-condition?

(and-condition? entity)

Check if entity is of type AndCondition.

column

(column & rest)

Function for creating an entity of type Column.

It accepts (a subset of) the following sub-entities:

For instance,

(column (literal-string ...)
        (column-alias ...))

column-alias

(column-alias & rest)

Function for creating an entity of type ColumnAlias.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(column-alias "...")

column-alias?

(column-alias? entity)

Check if entity is of type ColumnAlias.

column-definition

(column-definition & rest)

Function for creating an entity of type ColumnDefinition.

It accepts (a subset of) the following sub-entities:

For instance,

(column-definition (column-name ...)
                   (data-type ...))

column-definition?

(column-definition? entity)

Check if entity is of type ColumnDefinition.

column-name

(column-name & rest)

Function for creating an entity of type ColumnName.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(column-name "...")

column-name?

(column-name? entity)

Check if entity is of type ColumnName.

column?

(column? entity)

Check if entity is of type Column.

compare-equals

(compare-equals & rest)

Function for creating an entity of type CompareEquals.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-equals (literal-string ...))

compare-equals?

(compare-equals? entity)

Check if entity is of type CompareEquals.

compare-greater

(compare-greater & rest)

Function for creating an entity of type CompareGreater.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-greater (literal-string ...))

compare-greater-equals

(compare-greater-equals & rest)

Function for creating an entity of type CompareGreaterEquals.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-greater-equals (literal-string ...))

compare-greater-equals?

(compare-greater-equals? entity)

Check if entity is of type CompareGreaterEquals.

compare-greater?

(compare-greater? entity)

Check if entity is of type CompareGreater.

compare-less

(compare-less & rest)

Function for creating an entity of type CompareLess.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-less (literal-string ...))

compare-less-equals

(compare-less-equals & rest)

Function for creating an entity of type CompareLessEquals.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-less-equals (literal-string ...))

compare-less-equals?

(compare-less-equals? entity)

Check if entity is of type CompareLessEquals.

compare-less?

(compare-less? entity)

Check if entity is of type CompareLess.

compare-not-equals

(compare-not-equals & rest)

Function for creating an entity of type CompareNotEquals.

It accepts (a subset of) the following sub-entities:

For instance,

(compare-not-equals (literal-string ...))

compare-not-equals?

(compare-not-equals? entity)

Check if entity is of type CompareNotEquals.

compile-sql

multimethod

Compiles the given entity into an SQL string, using record-type for dispatch.

condition?

(condition? entity)

Check if entity is of type Condition.

cross-join

(cross-join)

Function for creating an entity of type CrossJoin.

It has no sub-entities.

For instance,

(cross-join)

cross-join?

(cross-join? entity)

Check if entity is of type CrossJoin.

current-row

(current-row)

Function for creating an entity of type CurrentRow.

It has no sub-entities.

For instance,

(current-row)

current-row?

(current-row? entity)

Check if entity is of type CurrentRow.

data-type

(data-type & rest)

Function for creating an entity of type DataType.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(data-type "...")

data-type?

(data-type? entity)

Check if entity is of type DataType.

desc

(desc)

Function for creating an entity of type Desc.

It has no sub-entities.

For instance,

(desc)

desc?

(desc? entity)

Check if entity is of type Desc.

distinct

(distinct)

Function for creating an entity of type Distinct.

It has no sub-entities.

For instance,

(distinct)

distinct?

(distinct? entity)

Check if entity is of type Distinct.

except

(except & rest)

Function for creating an entity of type Except.

It accepts (a subset of) the following sub-entities:

For instance,

(except (all ...)
        (select ...))

except?

(except? entity)

Check if entity is of type Except.

expression?

(expression? entity)

Check if entity is of type Expression.

frame-clause

(frame-clause & rest)

Function for creating an entity of type FrameClause.

It accepts (a subset of) the following sub-entities:

For instance,

(frame-clause (window-range ...)
              (window-rows ...)
              (current-row ...))

frame-clause?

(frame-clause? entity)

Check if entity is of type FrameClause.

from-function

(from-function & rest)

Function for creating an entity of type FromFunction.

It accepts (a subset of) the following sub-entities:

For instance,

(from-function (function-name ...)
               (function-argument ...)
               (name-alias ...)
               (column-alias ...)
               (column-definition ...))

from-function?

(from-function? entity)

Check if entity is of type FromFunction.

from-item?

(from-item? entity)

Check if entity is of type FromItem.

full-join

(full-join)

Function for creating an entity of type FullJoin.

It has no sub-entities.

For instance,

(full-join)

full-join?

(full-join? entity)

Check if entity is of type FullJoin.

function-argument

(function-argument & rest)

Function for creating an entity of type FunctionArgument.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(function-argument "...")

function-argument?

(function-argument? entity)

Check if entity is of type FunctionArgument.

function-call

(function-call & rest)

Function for creating an entity of type FunctionCall.

It accepts (a subset of) the following sub-entities:

For instance,

(function-call (function-name ...)
               (expression ...)
               (star ...))

function-call?

(function-call? entity)

Check if entity is of type FunctionCall.

function-name

(function-name & rest)

Function for creating an entity of type FunctionName.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(function-name "...")

function-name?

(function-name? entity)

Check if entity is of type FunctionName.

group

(group & rest)

Function for creating an entity of type Group.

It accepts (a subset of) the following sub-entities:

For instance,

(group (literal-string ...))

group?

(group? entity)

Check if entity is of type Group.

having

(having & rest)

Function for creating an entity of type Having.

It accepts (a subset of) the following sub-entities:

For instance,

(having (or-condition ...))

having?

(having? entity)

Check if entity is of type Having.

inner-join

(inner-join)

Function for creating an entity of type InnerJoin.

It has no sub-entities.

For instance,

(inner-join)

inner-join?

(inner-join? entity)

Check if entity is of type InnerJoin.

insert

(insert & rest)

Function for creating an entity of type Insert.

It accepts (a subset of) the following sub-entities:

For instance,

(insert (recursive-with ...)
        (with-query ...)
        (table-name ...)
        (column ...)
        (values ...)
        (select ...)
        (returning ...))

insert?

(insert? entity)

Check if entity is of type Insert.

intersect

(intersect & rest)

Function for creating an entity of type Intersect.

It accepts (a subset of) the following sub-entities:

For instance,

(intersect (all ...)
           (select ...))

intersect?

(intersect? entity)

Check if entity is of type Intersect.

into

(into & rest)

Function for creating an entity of type Into.

It accepts (a subset of) the following sub-entities:

For instance,

(into (table-name ...))

into?

(into? entity)

Check if entity is of type Into.

is-not-null

(is-not-null & rest)

Function for creating an entity of type IsNotNull.

It accepts (a subset of) the following sub-entities:

For instance,

(is-not-null (literal-string ...))

is-not-null?

(is-not-null? entity)

Check if entity is of type IsNotNull.

is-null

(is-null & rest)

Function for creating an entity of type IsNull.

It accepts (a subset of) the following sub-entities:

For instance,

(is-null (literal-string ...))

is-null?

(is-null? entity)

Check if entity is of type IsNull.

join

(join & rest)

Function for creating an entity of type Join.

It accepts (a subset of) the following sub-entities:

For instance,

(join (inner-join ...)
      (natural ...)
      (from-item ...)
      (or-condition ...)
      (column-name ...))

join-type?

(join-type? entity)

Check if entity is of type JoinType.

join?

(join? entity)

Check if entity is of type Join.

lateral

(lateral)

Function for creating an entity of type Lateral.

It has no sub-entities.

For instance,

(lateral)

lateral?

(lateral? entity)

Check if entity is of type Lateral.

left-join

(left-join)

Function for creating an entity of type LeftJoin.

It has no sub-entities.

For instance,

(left-join)

left-join?

(left-join? entity)

Check if entity is of type LeftJoin.

limit

(limit & rest)

Function for creating an entity of type Limit.

It accepts (a subset of) the following sub-entities:

For instance,

(limit (literal-string ...)
       (all ...))

limit?

(limit? entity)

Check if entity is of type Limit.

literal-string

(literal-string & rest)

Function for creating an entity of type LiteralString.

It accepts (a subset of) the following sub-entities:

  • A single String with the name expression.

For instance,

(literal-string "...")

literal-string?

(literal-string? entity)

Check if entity is of type LiteralString.

make-all

(make-all)

Function for creating an entity of type All.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-all)

make-and-condition

(make-and-condition & {:or {conditions #{}}, :keys [conditions]})

Function for creating an entity of type AndCondition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-and-condition :conditions [ ... ])

make-column

(make-column & {:or {expression nil, alias nil}, :keys [expression alias]})

Function for creating an entity of type Column.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-column :expression ...
             :alias ...)

make-column-alias

(make-column-alias & {:or {string nil}, :keys [string]})

Function for creating an entity of type ColumnAlias.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-column-alias "...")

make-column-definition

(make-column-definition & {:or {column-name nil, data-type nil}, :keys [column-name data-type]})

Function for creating an entity of type ColumnDefinition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-column-definition :column-name ...
                        :data-type ...)

make-column-name

(make-column-name & {:or {string nil}, :keys [string]})

Function for creating an entity of type ColumnName.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-column-name "...")

make-compare-equals

(make-compare-equals & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareEquals.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-equals :expressions [ ... ])

make-compare-greater

(make-compare-greater & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareGreater.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-greater :expressions [ ... ])

make-compare-greater-equals

(make-compare-greater-equals & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareGreaterEquals.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-greater-equals :expressions [ ... ])

make-compare-less

(make-compare-less & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareLess.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-less :expressions [ ... ])

make-compare-less-equals

(make-compare-less-equals & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareLessEquals.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-less-equals :expressions [ ... ])

make-compare-not-equals

(make-compare-not-equals & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type CompareNotEquals.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-compare-not-equals :expressions [ ... ])

make-cross-join

(make-cross-join)

Function for creating an entity of type CrossJoin.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-cross-join)

make-current-row

(make-current-row)

Function for creating an entity of type CurrentRow.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-current-row)

make-data-type

(make-data-type & {:or {string nil}, :keys [string]})

Function for creating an entity of type DataType.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-data-type "...")

make-desc

(make-desc)

Function for creating an entity of type Desc.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-desc)

make-distinct

(make-distinct)

Function for creating an entity of type Distinct.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-distinct)

make-except

(make-except & {:or {all nil, select nil}, :keys [all select]})

Function for creating an entity of type Except.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-except :all ...
             :select ...)

make-frame-clause

(make-frame-clause & {:or {range nil, rows nil, frames []}, :keys [range rows frames]})

Function for creating an entity of type FrameClause.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-frame-clause :range ...
                   :rows ...
                   :frames [ ... ])

make-from-function

(make-from-function & {:or {function-name nil, function-arguments [], alias nil, column-aliases [], column-definitions []}, :keys [function-name function-arguments alias column-aliases column-definitions]})

Function for creating an entity of type FromFunction.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-from-function :function-name ...
                    :function-arguments [ ... ]
                    :alias ...
                    :column-aliases [ ... ]
                    :column-definitions [ ... ])

make-full-join

(make-full-join)

Function for creating an entity of type FullJoin.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-full-join)

make-function-argument

(make-function-argument & {:or {string nil}, :keys [string]})

Function for creating an entity of type FunctionArgument.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-function-argument "...")

make-function-call

(make-function-call & {:or {function-name nil, parameters [], star nil}, :keys [function-name parameters star]})

Function for creating an entity of type FunctionCall.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-function-call :function-name ...
                    :parameters [ ... ]
                    :star ...)

make-function-name

(make-function-name & {:or {string nil}, :keys [string]})

Function for creating an entity of type FunctionName.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-function-name "...")

make-group

(make-group & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type Group.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-group :expression ...)

make-having

(make-having & {:or {condition nil}, :keys [condition]})

Function for creating an entity of type Having.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-having :condition ...)

make-inner-join

(make-inner-join)

Function for creating an entity of type InnerJoin.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-inner-join)

make-insert

(make-insert & {:or {recursive-with nil, with-queries [], table-name nil, columns [], values nil, select nil, returning nil}, :keys [recursive-with with-queries table-name columns values select returning]})

Function for creating an entity of type Insert.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-insert :recursive-with ...
             :with-queries [ ... ]
             :table-name ...
             :columns [ ... ]
             :values ...
             :select ...
             :returning ...)

make-intersect

(make-intersect & {:or {all nil, select nil}, :keys [all select]})

Function for creating an entity of type Intersect.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-intersect :all ...
                :select ...)

make-into

(make-into & {:or {table nil}, :keys [table]})

Function for creating an entity of type Into.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-into :table ...)

make-is-not-null

(make-is-not-null & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type IsNotNull.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-is-not-null :expression ...)

make-is-null

(make-is-null & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type IsNull.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-is-null :expression ...)

make-join

(make-join & {:or {join-type nil, natural nil, from-items [], join-condition nil, join-columns []}, :keys [join-type natural from-items join-condition join-columns]})

Function for creating an entity of type Join.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-join :join-type ...
           :natural ...
           :from-items [ ... ]
           :join-condition ...
           :join-columns [ ... ])

make-lateral

(make-lateral)

Function for creating an entity of type Lateral.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-lateral)

make-left-join

(make-left-join)

Function for creating an entity of type LeftJoin.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-left-join)

make-limit

(make-limit & {:or {count nil, all nil}, :keys [count all]})

Function for creating an entity of type Limit.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-limit :count ...
            :all ...)

make-literal-string

(make-literal-string & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type LiteralString.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name expression.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-literal-string "...")

make-name-alias

(make-name-alias & {:or {string nil}, :keys [string]})

Function for creating an entity of type NameAlias.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-name-alias "...")

make-natural

(make-natural)

Function for creating an entity of type Natural.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-natural)

make-not-condition

(make-not-condition & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type NotCondition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-not-condition :expression ...)

make-nulls-first

(make-nulls-first)

Function for creating an entity of type NullsFirst.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-nulls-first)

make-nulls-last

(make-nulls-last)

Function for creating an entity of type NullsLast.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-nulls-last)

make-offset

(make-offset & {:or {start nil}, :keys [start]})

Function for creating an entity of type Offset.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-offset :start ...)

make-only

(make-only)

Function for creating an entity of type Only.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-only)

make-or-condition

(make-or-condition & {:or {conditions #{}}, :keys [conditions]})

Function for creating an entity of type OrCondition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-or-condition :conditions [ ... ])

make-order-by

(make-order-by & {:or {expression nil, desc nil, using nil, nulls-first nil, nulls-last nil}, :keys [expression desc using nulls-first nulls-last]})

Function for creating an entity of type OrderBy.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-order-by :expression ...
               :desc ...
               :using ...
               :nulls-first ...
               :nulls-last ...)

make-recursive-with

(make-recursive-with)

Function for creating an entity of type RecursiveWith.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-recursive-with)

make-returning

(make-returning & {:or {star nil, columns []}, :keys [star columns]})

Function for creating an entity of type Returning.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-returning :star ...
                :columns [ ... ])

make-right-join

(make-right-join)

Function for creating an entity of type RightJoin.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-right-join)

make-select

(make-select & {:or {set-operation nil, groups [], from-items [], with-queries [], into nil, limit nil, windows [], offset nil, columns [], havings #{}, recursive-with nil, star nil, distinct nil, wheres #{}, order-by []}, :keys [recursive-with distinct star columns with-queries from-items wheres groups havings windows set-operation order-by limit offset into]})

Function for creating an entity of type Select.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-select :recursive-with ...
             :distinct ...
             :star ...
             :columns [ ... ]
             :with-queries [ ... ]
             :from-items [ ... ]
             :wheres [ ... ]
             :groups [ ... ]
             :havings [ ... ]
             :windows [ ... ]
             :set-operation ...
             :order-by [ ... ]
             :limit ...
             :offset ...
             :into ...)

make-star

(make-star)

Function for creating an entity of type Star.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-star)

make-sub-select

(make-sub-select & {:or {lateral nil, select nil, values nil, alias nil, column-aliases []}, :keys [lateral select values alias column-aliases]})

Function for creating an entity of type SubSelect.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-sub-select :lateral ...
                 :select ...
                 :values ...
                 :alias ...
                 :column-aliases [ ... ])

make-table-expression

(make-table-expression & {:or {only nil, name nil, alias nil, column-aliases []}, :keys [only name alias column-aliases]})

Function for creating an entity of type TableExpression.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-table-expression :only ...
                       :name ...
                       :alias ...
                       :column-aliases [ ... ])

make-table-name

(make-table-name & {:or {string nil}, :keys [string]})

Function for creating an entity of type TableName.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-table-name "...")

make-unbounded-following

(make-unbounded-following)

Function for creating an entity of type UnboundedFollowing.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-unbounded-following)

make-unbounded-preceding

(make-unbounded-preceding)

Function for creating an entity of type UnboundedPreceding.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-unbounded-preceding)

make-union

(make-union & {:or {all nil, select nil}, :keys [all select]})

Function for creating an entity of type Union.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-union :all ...
            :select ...)

make-using

(make-using & {:or {operator nil}, :keys [operator]})

Function for creating an entity of type Using.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name operator.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-using "...")

make-value

(make-value & {:or {expressions []}, :keys [expressions]})

Function for creating an entity of type Value.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-value :expressions [ ... ])

make-value-following

(make-value-following & {:or {value nil}, :keys [value]})

Function for creating an entity of type ValueFollowing.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name value.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-value-following "...")

make-value-preceding

(make-value-preceding & {:or {value nil}, :keys [value]})

Function for creating an entity of type ValuePreceding.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name value.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-value-preceding "...")

make-values

(make-values & {:or {values []}, :keys [values]})

Function for creating an entity of type Values.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-values :values [ ... ])

make-where

(make-where & {:or {conditions #{}}, :keys [conditions]})

Function for creating an entity of type Where.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-where :conditions [ ... ])

make-window

(make-window & {:or {name nil, definition nil}, :keys [name definition]})

Function for creating an entity of type Window.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window :name ...
             :definition ...)

make-window-definition

(make-window-definition & {:or {name nil, partitions [], order-by [], frame-clause nil}, :keys [name partitions order-by frame-clause]})

Function for creating an entity of type WindowDefinition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window-definition :name ...
                        :partitions [ ... ]
                        :order-by [ ... ]
                        :frame-clause ...)

make-window-name

(make-window-name & {:or {string nil}, :keys [string]})

Function for creating an entity of type WindowName.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window-name "...")

make-window-partition

(make-window-partition & {:or {expression nil}, :keys [expression]})

Function for creating an entity of type WindowPartition.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window-partition :expression ...)

make-window-range

(make-window-range)

Function for creating an entity of type WindowRange.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window-range)

make-window-rows

(make-window-rows)

Function for creating an entity of type WindowRows.

It has no sub-entities.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-window-rows)

make-with-query

(make-with-query & {:or {with-query-name nil, column-names [], with-select nil, with-insert nil}, :keys [with-query-name column-names with-select with-insert]})

Function for creating an entity of type WithQuery.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-with-query :with-query-name ...
                 :column-names [ ... ]
                 :with-select ...
                 :with-insert ...)

make-with-query-name

(make-with-query-name & {:or {string nil}, :keys [string]})

Function for creating an entity of type WithQueryName.

It accepts (a subset of) the following sub-entities, specified by keyword:

  • A single String with the name string.

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-with-query-name "...")

make-with-select

(make-with-select & {:or {with-query-name nil, alias nil, column-aliases []}, :keys [with-query-name alias column-aliases]})

Function for creating an entity of type WithSelect.

It accepts (a subset of) the following sub-entities, specified by keyword:

Sub-entities that take multiple values should be given as vectors.

For instance,

(make-with-select :with-query-name ...
                  :alias ...
                  :column-aliases [ ... ])

name-alias

(name-alias & rest)

Function for creating an entity of type NameAlias.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(name-alias "...")

name-alias?

(name-alias? entity)

Check if entity is of type NameAlias.

natural

(natural)

Function for creating an entity of type Natural.

It has no sub-entities.

For instance,

(natural)

natural?

(natural? entity)

Check if entity is of type Natural.

not-condition

(not-condition & rest)

Function for creating an entity of type NotCondition.

It accepts (a subset of) the following sub-entities:

For instance,

(not-condition (condition ...))

not-condition?

(not-condition? entity)

Check if entity is of type NotCondition.

nulls-first

(nulls-first)

Function for creating an entity of type NullsFirst.

It has no sub-entities.

For instance,

(nulls-first)

nulls-first?

(nulls-first? entity)

Check if entity is of type NullsFirst.

nulls-last

(nulls-last)

Function for creating an entity of type NullsLast.

It has no sub-entities.

For instance,

(nulls-last)

nulls-last?

(nulls-last? entity)

Check if entity is of type NullsLast.

offset

(offset & rest)

Function for creating an entity of type Offset.

It accepts (a subset of) the following sub-entities:

For instance,

(offset (literal-string ...))

offset?

(offset? entity)

Check if entity is of type Offset.

only

(only)

Function for creating an entity of type Only.

It has no sub-entities.

For instance,

(only)

only?

(only? entity)

Check if entity is of type Only.

or-condition

(or-condition & rest)

Function for creating an entity of type OrCondition.

It accepts (a subset of) the following sub-entities:

For instance,

(or-condition (condition ...))

or-condition?

(or-condition? entity)

Check if entity is of type OrCondition.

order-by

(order-by & rest)

Function for creating an entity of type OrderBy.

It accepts (a subset of) the following sub-entities:

For instance,

(order-by (literal-string ...)
          (desc ...)
          (using ...)
          (nulls-first ...)
          (nulls-last ...))

order-by?

(order-by? entity)

Check if entity is of type OrderBy.

record-type

multimethod

Returns a qualified keyword identifying the record type of an entity, dispatching on type.

recursive-with

(recursive-with)

Function for creating an entity of type RecursiveWith.

It has no sub-entities.

For instance,

(recursive-with)

recursive-with?

(recursive-with? entity)

Check if entity is of type RecursiveWith.

returning

(returning & rest)

Function for creating an entity of type Returning.

It accepts (a subset of) the following sub-entities:

For instance,

(returning (star ...)
           (column ...))

returning?

(returning? entity)

Check if entity is of type Returning.

right-join

(right-join)

Function for creating an entity of type RightJoin.

It has no sub-entities.

For instance,

(right-join)

right-join?

(right-join? entity)

Check if entity is of type RightJoin.

select

(select & rest)

Function for creating an entity of type Select.

It accepts (a subset of) the following sub-entities:

For instance,

(select (recursive-with ...)
        (distinct ...)
        (star ...)
        (column ...)
        (with-query ...)
        (table-name ...)
        (where ...)
        (group ...)
        (having ...)
        (window ...)
        (union ...)
        (order-by ...)
        (limit ...)
        (offset ...)
        (into ...))

select?

(select? entity)

Check if entity is of type Select.

set-operation?

(set-operation? entity)

Check if entity is of type SetOperation.

star

(star)

Function for creating an entity of type Star.

It has no sub-entities.

For instance,

(star)

star?

(star? entity)

Check if entity is of type Star.

sub-select

(sub-select & rest)

Function for creating an entity of type SubSelect.

It accepts (a subset of) the following sub-entities:

For instance,

(sub-select (lateral ...)
            (select ...)
            (values ...)
            (name-alias ...)
            (column-alias ...))

sub-select?

(sub-select? entity)

Check if entity is of type SubSelect.

table-expression

(table-expression & rest)

Function for creating an entity of type TableExpression.

It accepts (a subset of) the following sub-entities:

For instance,

(table-expression (only ...)
                  (table-name ...)
                  (name-alias ...)
                  (column-alias ...))

table-expression?

(table-expression? entity)

Check if entity is of type TableExpression.

table-name

(table-name & rest)

Function for creating an entity of type TableName.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(table-name "...")

table-name?

(table-name? entity)

Check if entity is of type TableName.

unbounded-following

(unbounded-following)

Function for creating an entity of type UnboundedFollowing.

It has no sub-entities.

For instance,

(unbounded-following)

unbounded-following?

(unbounded-following? entity)

Check if entity is of type UnboundedFollowing.

unbounded-preceding

(unbounded-preceding)

Function for creating an entity of type UnboundedPreceding.

It has no sub-entities.

For instance,

(unbounded-preceding)

unbounded-preceding?

(unbounded-preceding? entity)

Check if entity is of type UnboundedPreceding.

union

(union & rest)

Function for creating an entity of type Union.

It accepts (a subset of) the following sub-entities:

For instance,

(union (all ...)
       (select ...))

union?

(union? entity)

Check if entity is of type Union.

update-and-condition

(update-and-condition entity & {:as rest, :keys [conditions]})

Function for updating an entity of type AndCondition.

See the documentation for make-and-condition for a description of the arguments.

update-column

(update-column entity & {:as rest, :keys [expression alias]})

Function for updating an entity of type Column.

See the documentation for make-column for a description of the arguments.

update-column-alias

(update-column-alias entity & {:as rest, :keys [string]})

Function for updating an entity of type ColumnAlias.

See the documentation for make-column-alias for a description of the arguments.

update-column-definition

(update-column-definition entity & {:as rest, :keys [column-name data-type]})

Function for updating an entity of type ColumnDefinition.

See the documentation for make-column-definition for a description of the arguments.

update-column-name

(update-column-name entity & {:as rest, :keys [string]})

Function for updating an entity of type ColumnName.

See the documentation for make-column-name for a description of the arguments.

update-compare-equals

(update-compare-equals entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareEquals.

See the documentation for make-compare-equals for a description of the arguments.

update-compare-greater

(update-compare-greater entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareGreater.

See the documentation for make-compare-greater for a description of the arguments.

update-compare-greater-equals

(update-compare-greater-equals entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareGreaterEquals.

See the documentation for make-compare-greater-equals for a description of the arguments.

update-compare-less

(update-compare-less entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareLess.

See the documentation for make-compare-less for a description of the arguments.

update-compare-less-equals

(update-compare-less-equals entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareLessEquals.

See the documentation for make-compare-less-equals for a description of the arguments.

update-compare-not-equals

(update-compare-not-equals entity & {:as rest, :keys [expressions]})

Function for updating an entity of type CompareNotEquals.

See the documentation for make-compare-not-equals for a description of the arguments.

update-data-type

(update-data-type entity & {:as rest, :keys [string]})

Function for updating an entity of type DataType.

See the documentation for make-data-type for a description of the arguments.

update-except

(update-except entity & {:as rest, :keys [all select]})

Function for updating an entity of type Except.

See the documentation for make-except for a description of the arguments.

update-frame-clause

(update-frame-clause entity & {:as rest, :keys [range rows frames]})

Function for updating an entity of type FrameClause.

See the documentation for make-frame-clause for a description of the arguments.

update-from-function

(update-from-function entity & {:as rest, :keys [function-name function-arguments alias column-aliases column-definitions]})

Function for updating an entity of type FromFunction.

See the documentation for make-from-function for a description of the arguments.

update-function-argument

(update-function-argument entity & {:as rest, :keys [string]})

Function for updating an entity of type FunctionArgument.

See the documentation for make-function-argument for a description of the arguments.

update-function-call

(update-function-call entity & {:as rest, :keys [function-name parameters star]})

Function for updating an entity of type FunctionCall.

See the documentation for make-function-call for a description of the arguments.

update-function-name

(update-function-name entity & {:as rest, :keys [string]})

Function for updating an entity of type FunctionName.

See the documentation for make-function-name for a description of the arguments.

update-group

(update-group entity & {:as rest, :keys [expression]})

Function for updating an entity of type Group.

See the documentation for make-group for a description of the arguments.

update-having

(update-having entity & {:as rest, :keys [condition]})

Function for updating an entity of type Having.

See the documentation for make-having for a description of the arguments.

update-insert

(update-insert entity & {:as rest, :keys [recursive-with with-queries table-name columns values select returning]})

Function for updating an entity of type Insert.

See the documentation for make-insert for a description of the arguments.

update-intersect

(update-intersect entity & {:as rest, :keys [all select]})

Function for updating an entity of type Intersect.

See the documentation for make-intersect for a description of the arguments.

update-into

(update-into entity & {:as rest, :keys [table]})

Function for updating an entity of type Into.

See the documentation for make-into for a description of the arguments.

update-is-not-null

(update-is-not-null entity & {:as rest, :keys [expression]})

Function for updating an entity of type IsNotNull.

See the documentation for make-is-not-null for a description of the arguments.

update-is-null

(update-is-null entity & {:as rest, :keys [expression]})

Function for updating an entity of type IsNull.

See the documentation for make-is-null for a description of the arguments.

update-join

(update-join entity & {:as rest, :keys [join-type natural from-items join-condition join-columns]})

Function for updating an entity of type Join.

See the documentation for make-join for a description of the arguments.

update-limit

(update-limit entity & {:as rest, :keys [count all]})

Function for updating an entity of type Limit.

See the documentation for make-limit for a description of the arguments.

update-literal-string

(update-literal-string entity & {:as rest, :keys [expression]})

Function for updating an entity of type LiteralString.

See the documentation for make-literal-string for a description of the arguments.

update-name-alias

(update-name-alias entity & {:as rest, :keys [string]})

Function for updating an entity of type NameAlias.

See the documentation for make-name-alias for a description of the arguments.

update-not-condition

(update-not-condition entity & {:as rest, :keys [expression]})

Function for updating an entity of type NotCondition.

See the documentation for make-not-condition for a description of the arguments.

update-offset

(update-offset entity & {:as rest, :keys [start]})

Function for updating an entity of type Offset.

See the documentation for make-offset for a description of the arguments.

update-or-condition

(update-or-condition entity & {:as rest, :keys [conditions]})

Function for updating an entity of type OrCondition.

See the documentation for make-or-condition for a description of the arguments.

update-order-by

(update-order-by entity & {:as rest, :keys [expression desc using nulls-first nulls-last]})

Function for updating an entity of type OrderBy.

See the documentation for make-order-by for a description of the arguments.

update-returning

(update-returning entity & {:as rest, :keys [star columns]})

Function for updating an entity of type Returning.

See the documentation for make-returning for a description of the arguments.

update-select

(update-select entity & {:as rest, :keys [recursive-with distinct star columns with-queries from-items wheres groups havings windows set-operation order-by limit offset into]})

Function for updating an entity of type Select.

See the documentation for make-select for a description of the arguments.

update-sub-select

(update-sub-select entity & {:as rest, :keys [lateral select values alias column-aliases]})

Function for updating an entity of type SubSelect.

See the documentation for make-sub-select for a description of the arguments.

update-table-expression

(update-table-expression entity & {:as rest, :keys [only name alias column-aliases]})

Function for updating an entity of type TableExpression.

See the documentation for make-table-expression for a description of the arguments.

update-table-name

(update-table-name entity & {:as rest, :keys [string]})

Function for updating an entity of type TableName.

See the documentation for make-table-name for a description of the arguments.

update-union

(update-union entity & {:as rest, :keys [all select]})

Function for updating an entity of type Union.

See the documentation for make-union for a description of the arguments.

update-using

(update-using entity & {:as rest, :keys [operator]})

Function for updating an entity of type Using.

See the documentation for make-using for a description of the arguments.

update-value

(update-value entity & {:as rest, :keys [expressions]})

Function for updating an entity of type Value.

See the documentation for make-value for a description of the arguments.

update-value-following

(update-value-following entity & {:as rest, :keys [value]})

Function for updating an entity of type ValueFollowing.

See the documentation for make-value-following for a description of the arguments.

update-value-preceding

(update-value-preceding entity & {:as rest, :keys [value]})

Function for updating an entity of type ValuePreceding.

See the documentation for make-value-preceding for a description of the arguments.

update-values

(update-values entity & {:as rest, :keys [values]})

Function for updating an entity of type Values.

See the documentation for make-values for a description of the arguments.

update-where

(update-where entity & {:as rest, :keys [conditions]})

Function for updating an entity of type Where.

See the documentation for make-where for a description of the arguments.

update-window

(update-window entity & {:as rest, :keys [name definition]})

Function for updating an entity of type Window.

See the documentation for make-window for a description of the arguments.

update-window-definition

(update-window-definition entity & {:as rest, :keys [name partitions order-by frame-clause]})

Function for updating an entity of type WindowDefinition.

See the documentation for make-window-definition for a description of the arguments.

update-window-name

(update-window-name entity & {:as rest, :keys [string]})

Function for updating an entity of type WindowName.

See the documentation for make-window-name for a description of the arguments.

update-window-partition

(update-window-partition entity & {:as rest, :keys [expression]})

Function for updating an entity of type WindowPartition.

See the documentation for make-window-partition for a description of the arguments.

update-with-query

(update-with-query entity & {:as rest, :keys [with-query-name column-names with-select with-insert]})

Function for updating an entity of type WithQuery.

See the documentation for make-with-query for a description of the arguments.

update-with-query-name

(update-with-query-name entity & {:as rest, :keys [string]})

Function for updating an entity of type WithQueryName.

See the documentation for make-with-query-name for a description of the arguments.

update-with-select

(update-with-select entity & {:as rest, :keys [with-query-name alias column-aliases]})

Function for updating an entity of type WithSelect.

See the documentation for make-with-select for a description of the arguments.

using

(using & rest)

Function for creating an entity of type Using.

It accepts (a subset of) the following sub-entities:

  • A single String with the name operator.

For instance,

(using "...")

using?

(using? entity)

Check if entity is of type Using.

value

(value & rest)

Function for creating an entity of type Value.

It accepts (a subset of) the following sub-entities:

For instance,

(value (expression ...))

value-following

(value-following & rest)

Function for creating an entity of type ValueFollowing.

It accepts (a subset of) the following sub-entities:

  • A single String with the name value.

For instance,

(value-following "...")

value-following?

(value-following? entity)

Check if entity is of type ValueFollowing.

value-preceding

(value-preceding & rest)

Function for creating an entity of type ValuePreceding.

It accepts (a subset of) the following sub-entities:

  • A single String with the name value.

For instance,

(value-preceding "...")

value-preceding?

(value-preceding? entity)

Check if entity is of type ValuePreceding.

value?

(value? entity)

Check if entity is of type Value.

values

(values & rest)

Function for creating an entity of type Values.

It accepts (a subset of) the following sub-entities:

For instance,

(values (value ...))

values?

(values? entity)

Check if entity is of type Values.

where

(where & rest)

Function for creating an entity of type Where.

It accepts (a subset of) the following sub-entities:

For instance,

(where (or-condition ...))

where?

(where? entity)

Check if entity is of type Where.

window

(window & rest)

Function for creating an entity of type Window.

It accepts (a subset of) the following sub-entities:

For instance,

(window (window-name ...)
        (window-definition ...))

window-definition

(window-definition & rest)

Function for creating an entity of type WindowDefinition.

It accepts (a subset of) the following sub-entities:

For instance,

(window-definition (window-name ...)
                   (window-partition ...)
                   (order-by ...)
                   (frame-clause ...))

window-definition?

(window-definition? entity)

Check if entity is of type WindowDefinition.

window-frame?

(window-frame? entity)

Check if entity is of type WindowFrame.

window-name

(window-name & rest)

Function for creating an entity of type WindowName.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(window-name "...")

window-name?

(window-name? entity)

Check if entity is of type WindowName.

window-partition

(window-partition & rest)

Function for creating an entity of type WindowPartition.

It accepts (a subset of) the following sub-entities:

For instance,

(window-partition (literal-string ...))

window-partition?

(window-partition? entity)

Check if entity is of type WindowPartition.

window-range

(window-range)

Function for creating an entity of type WindowRange.

It has no sub-entities.

For instance,

(window-range)

window-range?

(window-range? entity)

Check if entity is of type WindowRange.

window-rows

(window-rows)

Function for creating an entity of type WindowRows.

It has no sub-entities.

For instance,

(window-rows)

window-rows?

(window-rows? entity)

Check if entity is of type WindowRows.

window?

(window? entity)

Check if entity is of type Window.

with-query

(with-query & rest)

Function for creating an entity of type WithQuery.

It accepts (a subset of) the following sub-entities:

For instance,

(with-query (with-query-name ...)
            (column-name ...)
            (select ...)
            (insert ...))

with-query-name

(with-query-name & rest)

Function for creating an entity of type WithQueryName.

It accepts (a subset of) the following sub-entities:

  • A single String with the name string.

For instance,

(with-query-name "...")

with-query-name?

(with-query-name? entity)

Check if entity is of type WithQueryName.

with-query?

(with-query? entity)

Check if entity is of type WithQuery.

with-select

(with-select & rest)

Function for creating an entity of type WithSelect.

It accepts (a subset of) the following sub-entities:

For instance,

(with-select (with-query-name ...)
             (name-alias ...)
             (column-alias ...))

with-select?

(with-select? entity)

Check if entity is of type WithSelect.