Functions
The following functions are available globally.
-
Create an
AggregateColumnExpression
using the AVG function.Declaration
Swift
public func avg(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the MAX function.Declaration
Swift
public func max(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the MIN function.Declaration
Swift
public func min(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the SUM function.Declaration
Swift
public func sum(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the LAST function.Declaration
Swift
public func last(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the FIRST function.Declaration
Swift
public func first(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the COUNT function.Declaration
Swift
public func count(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create an
AggregateColumnExpression
using the COUNT DISTINCT function.Declaration
Swift
public func countDistinct(_ field: Field) -> AggregateColumnExpression
Parameters
field
The
Field
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create a
AggregateColumnExpression
using the LEN function.Declaration
Swift
public func len(_ field: AggregateColumnExpression) -> AggregateColumnExpression
Parameters
field
The
AggregateColumnExpression
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create a
AggregateColumnExpression
the using UCASE function.Declaration
Swift
public func ucase(_ field: AggregateColumnExpression) -> AggregateColumnExpression
Parameters
field
The
AggregateColumnExpression
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create a
AggregateColumnExpression
using the LCASE function.Declaration
Swift
public func lcase(_ field: AggregateColumnExpression) -> AggregateColumnExpression
Parameters
field
The
AggregateColumnExpression
to apply the function on.Return Value
An instance of
AggregateColumnExpression
. -
Create a
AggregateColumnExpression
using the ROUND function.Declaration
Swift
public func round(_ field: AggregateColumnExpression, to decimal: Int) -> AggregateColumnExpression
Parameters
field
The
AggregateColumnExpression
to apply the function on.to
The decimal to round the values to.
Return Value
An instance of
AggregateColumnExpression
. -
Create a
AggregateColumnExpression
using the MID function.Declaration
Swift
public func mid(_ field: AggregateColumnExpression, start: Int, length: Int) -> AggregateColumnExpression
Parameters
field
The
AggregateColumnExpression
to apply the function on.start
The starting position for the text extraction.
length
The number of characters to return.
Return Value
An instance of
AggregateColumnExpression
.
-
Create a
FilterPredicate
using the ANY operator.Declaration
Swift
public func any(_ query: Select) -> Predicate<Filter, ScalarColumnExpression>
Parameters
query
The
Select
query to apply ANY on.Return Value
A
Predicate<Filter, ScalarColumnExpression>
containing the anySubquery. -
Create a
FilterPredicate
using the ALL operator.Declaration
Swift
public func all(_ query: Select) -> Predicate<Filter, ScalarColumnExpression>
Parameters
query
The
Select
query to apply ALL on.Return Value
A
Predicate<Filter, ScalarColumnExpression>
containing the allSubquery.
-
Create a
HavingPredicate
using the ANY operator.Declaration
Swift
public func any(_ query: Select) -> Predicate<Having, AggregateColumnExpression>
Parameters
query
The
Select
query to apply ANY on.Return Value
A
Predicate<Having, AggregateColumnExpression>
containing the anySubquery. -
Create a
HavingPredicate
using the ALL operator.Declaration
Swift
public func all(_ query: Select) -> Predicate<Having, AggregateColumnExpression>
Parameters
query
The
Select
query to apply ALL on.Return Value
A
Predicate<Having, AggregateColumnExpression>
containing the allSubquery.
-
Create a IndexColumnOrdered.ASC for the column.
Declaration
Swift
public func asc(_ column: Column) -> IndexColumnOrdered
Parameters
column
The column to apply IndexColumnOrdered.ASC.
Return Value
IndexColumnOrdered.ASC for the column.
-
Create a IndexColumnOrdered.DESC for the column.
Declaration
Swift
public func desc(_ column: Column) -> IndexColumnOrdered
Parameters
column
The column to apply IndexColumnOrdered.ASC.
Return Value
IndexColumnOrdered.DESC for the column.
-
Create a
ScalarColumnExpression
using the NOW function.Declaration
Swift
public func now() -> ScalarColumnExpression
Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the LEN function.Declaration
Swift
public func len(_ field: ScalarColumnExpression) -> ScalarColumnExpression
Parameters
field
The
ScalarColumnExpression
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the UCASE function.Declaration
Swift
public func ucase(_ field: ScalarColumnExpression) -> ScalarColumnExpression
Parameters
field
The
ScalarColumnExpression
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the LCASE function.Declaration
Swift
public func lcase(_ field: ScalarColumnExpression) -> ScalarColumnExpression
Parameters
field
The
ScalarColumnExpression
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the ROUND function.Declaration
Swift
public func round(_ field: ScalarColumnExpression, to decimal: Int) -> ScalarColumnExpression
Parameters
field
The
ScalarColumnExpression
to apply the function on.to
The decimal to round the values to.
Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the MID function.Declaration
Swift
public func mid(_ field: ScalarColumnExpression, start: Int, length: Int) -> ScalarColumnExpression
Parameters
field
The
ScalarColumnExpression
to apply the function on.start
The starting position for the text extraction.
length
The number of characters to return.
Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the LEN function.Declaration
Swift
public func len(_ field: Column) -> ScalarColumnExpression
Parameters
field
The
Column
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the UCASE function.Declaration
Swift
public func ucase(_ field: Column) -> ScalarColumnExpression
Parameters
field
The
Column
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the LCASE function.Declaration
Swift
public func lcase(_ field: Column) -> ScalarColumnExpression
Parameters
field
The
Column
to apply the function on.Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the ROUND function.Declaration
Swift
public func round(_ field: Column, to decimal: Int) -> ScalarColumnExpression
Parameters
field
The
Column
to apply the function on.to
The decimal to round the values to.
Return Value
An instance of
ScalarColumnExpression
. -
Create a
ScalarColumnExpression
using the MID function.Declaration
Swift
public func mid(_ field: Column, start: Int, length: Int) -> ScalarColumnExpression
Parameters
field
The
Column
to apply the function on.start
The starting position for the text extraction.
length
The number of characters to return.
Return Value
An instance of
ScalarColumnExpression
.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ table: AuxiliaryTable, _ query: Select) -> Select
Parameters
table
A table for a WITH clause.
query
A SELECT query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ tables: [AuxiliaryTable], _ query: Select) -> Select
Parameters
tables
An array of tables for a WITH clause.
query
A SELECT query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ table: AuxiliaryTable, _ query: Insert) -> Insert
Parameters
table
A table for a WITH clause.
query
An INSERT query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ tables: [AuxiliaryTable], _ query: Insert) -> Insert
Parameters
tables
An array of tables for a WITH clause.
query
An INSERT query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ table: AuxiliaryTable, _ query: Update) -> Update
Parameters
table
A table for a WITH clause.
query
An UPDATE query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ tables: [AuxiliaryTable], _ query: Update) -> Update
Parameters
tables
An array of tables for a WITH clause.
query
An UPDATE query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ table: AuxiliaryTable, _ query: Delete) -> Delete
Parameters
table
A table for a WITH clause.
query
A DELETE query that will use the table from the WITH clause.
-
Create a query with a WITH clause.
Declaration
Swift
public func with(_ tables: [AuxiliaryTable], _ query: Delete) -> Delete
Parameters
tables
An array of tables for a WITH clause.
query
A DELETE query that will use the table from the WITH clause.