Functions
The following functions are available globally.
-
Create an
AggregateColumnExpressionusing the AVG function.Declaration
Swift
public func avg(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the MAX function.Declaration
Swift
public func max(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the MIN function.Declaration
Swift
public func min(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the SUM function.Declaration
Swift
public func sum(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the LAST function.Declaration
Swift
public func last(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the FIRST function.Declaration
Swift
public func first(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the COUNT function.Declaration
Swift
public func count(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create an
AggregateColumnExpressionusing the COUNT DISTINCT function.Declaration
Swift
public func countDistinct(_ field: Field) -> AggregateColumnExpressionParameters
fieldThe
Fieldto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create a
AggregateColumnExpressionusing the LEN function.Declaration
Swift
public func len(_ field: AggregateColumnExpression) -> AggregateColumnExpressionParameters
fieldThe
AggregateColumnExpressionto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create a
AggregateColumnExpressionthe using UCASE function.Declaration
Swift
public func ucase(_ field: AggregateColumnExpression) -> AggregateColumnExpressionParameters
fieldThe
AggregateColumnExpressionto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create a
AggregateColumnExpressionusing the LCASE function.Declaration
Swift
public func lcase(_ field: AggregateColumnExpression) -> AggregateColumnExpressionParameters
fieldThe
AggregateColumnExpressionto apply the function on.Return Value
An instance of
AggregateColumnExpression. -
Create a
AggregateColumnExpressionusing the ROUND function.Declaration
Swift
public func round(_ field: AggregateColumnExpression, to decimal: Int) -> AggregateColumnExpressionParameters
fieldThe
AggregateColumnExpressionto apply the function on.toThe decimal to round the values to.
Return Value
An instance of
AggregateColumnExpression. -
Create a
AggregateColumnExpressionusing the MID function.Declaration
Swift
public func mid(_ field: AggregateColumnExpression, start: Int, length: Int) -> AggregateColumnExpressionParameters
fieldThe
AggregateColumnExpressionto apply the function on.startThe starting position for the text extraction.
lengthThe number of characters to return.
Return Value
An instance of
AggregateColumnExpression.
-
Create a
FilterPredicateusing the ANY operator.Declaration
Swift
public func any(_ query: Select) -> Predicate<Filter, ScalarColumnExpression>Parameters
queryThe
Selectquery to apply ANY on.Return Value
A
Predicate<Filter, ScalarColumnExpression>containing the anySubquery. -
Create a
FilterPredicateusing the ALL operator.Declaration
Swift
public func all(_ query: Select) -> Predicate<Filter, ScalarColumnExpression>Parameters
queryThe
Selectquery to apply ALL on.Return Value
A
Predicate<Filter, ScalarColumnExpression>containing the allSubquery.
-
Create a
HavingPredicateusing the ANY operator.Declaration
Swift
public func any(_ query: Select) -> Predicate<Having, AggregateColumnExpression>Parameters
queryThe
Selectquery to apply ANY on.Return Value
A
Predicate<Having, AggregateColumnExpression>containing the anySubquery. -
Create a
HavingPredicateusing the ALL operator.Declaration
Swift
public func all(_ query: Select) -> Predicate<Having, AggregateColumnExpression>Parameters
queryThe
Selectquery 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) -> IndexColumnOrderedParameters
columnThe 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) -> IndexColumnOrderedParameters
columnThe column to apply IndexColumnOrdered.ASC.
Return Value
IndexColumnOrdered.DESC for the column.
-
Create a
ScalarColumnExpressionusing the NOW function.Declaration
Swift
public func now() -> ScalarColumnExpressionReturn Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the LEN function.Declaration
Swift
public func len(_ field: ScalarColumnExpression) -> ScalarColumnExpressionParameters
fieldThe
ScalarColumnExpressionto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the UCASE function.Declaration
Swift
public func ucase(_ field: ScalarColumnExpression) -> ScalarColumnExpressionParameters
fieldThe
ScalarColumnExpressionto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the LCASE function.Declaration
Swift
public func lcase(_ field: ScalarColumnExpression) -> ScalarColumnExpressionParameters
fieldThe
ScalarColumnExpressionto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the ROUND function.Declaration
Swift
public func round(_ field: ScalarColumnExpression, to decimal: Int) -> ScalarColumnExpressionParameters
fieldThe
ScalarColumnExpressionto apply the function on.toThe decimal to round the values to.
Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the MID function.Declaration
Swift
public func mid(_ field: ScalarColumnExpression, start: Int, length: Int) -> ScalarColumnExpressionParameters
fieldThe
ScalarColumnExpressionto apply the function on.startThe starting position for the text extraction.
lengthThe number of characters to return.
Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the LEN function.Declaration
Swift
public func len(_ field: Column) -> ScalarColumnExpressionParameters
fieldThe
Columnto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the UCASE function.Declaration
Swift
public func ucase(_ field: Column) -> ScalarColumnExpressionParameters
fieldThe
Columnto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the LCASE function.Declaration
Swift
public func lcase(_ field: Column) -> ScalarColumnExpressionParameters
fieldThe
Columnto apply the function on.Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the ROUND function.Declaration
Swift
public func round(_ field: Column, to decimal: Int) -> ScalarColumnExpressionParameters
fieldThe
Columnto apply the function on.toThe decimal to round the values to.
Return Value
An instance of
ScalarColumnExpression. -
Create a
ScalarColumnExpressionusing the MID function.Declaration
Swift
public func mid(_ field: Column, start: Int, length: Int) -> ScalarColumnExpressionParameters
fieldThe
Columnto apply the function on.startThe starting position for the text extraction.
lengthThe 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) -> SelectParameters
tableA table for a WITH clause.
queryA 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) -> SelectParameters
tablesAn array of tables for a WITH clause.
queryA 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) -> InsertParameters
tableA table for a WITH clause.
queryAn 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) -> InsertParameters
tablesAn array of tables for a WITH clause.
queryAn 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) -> UpdateParameters
tableA table for a WITH clause.
queryAn 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) -> UpdateParameters
tablesAn array of tables for a WITH clause.
queryAn 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) -> DeleteParameters
tableA table for a WITH clause.
queryA 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) -> DeleteParameters
tablesAn array of tables for a WITH clause.
queryA DELETE query that will use the table from the WITH clause.
View on GitHub
Functions Reference