SQLOrderingTerm
public protocol SQLOrderingTerm
The protocol for all types that can be used as an SQL ordering term, as described at https://www.sqlite.org/syntax/ordering-term.html
-
The ordering term, reversed
Declaration
Swift
var reversed: SQLOrderingTerm -
Returns an SQL string that represents the ordering term.
When the arguments parameter is nil, any value must be written down as a literal in the returned SQL:
var arguments: StatementArguments? = nil let orderingTerm = Column("name") ?? "Anonymous" orderingTerm.orderingTermSQL(&arguments) // "IFNULL(name, 'Anonymous')"When the arguments parameter is not nil, then values may be replaced by
?or colon-prefixed tokens, and fed into arguments.var arguments = StatementArguments() let orderingTerm = Column("name") ?? "Anonymous" orderingTerm.orderingTermSQL(&arguments) // "IFNULL(name, ?)" arguments // ["Anonymous"]Declaration
Swift
func orderingTermSQL(_ arguments: inout StatementArguments?) -> String
View on GitHub
Install in Dash
SQLOrderingTerm Protocol Reference