SQLCollatedExpression
public struct SQLCollatedExpression : SQLOrderingTerm
SQLCollatedExpression taints an expression so that every derived expression is eventually evaluated using an SQLite collation.
You create one by calling the collating()
method:
let email = Column("email").collating(.nocase)
// SELECT * FROM player WHERE email = 'arthur@example.com' COLLATE NOCASE
Player.filter(email == "arthur@example.com")
-
The tainted expression
Declaration
Swift
public let expression: SQLExpression
-
The name of the collation
Declaration
Swift
public let collationName: Database.CollationName
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE ASC Player.order(email.asc)
See https://github.com/groue/GRDB.swift/#the-query-interface
Declaration
Swift
public var asc: SQLOrdering { get }
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE DESC Player.order(email.desc)
See https://github.com/groue/GRDB.swift/#the-query-interface
Declaration
Swift
public var desc: SQLOrdering { get }
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE ASC NULLS LAST Player.order(email.ascNullsLast)
See https://github.com/groue/GRDB.swift/#the-query-interface
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE DESC NULLS FIRST Player.order(email.descNullsFirst)
See https://github.com/groue/GRDB.swift/#the-query-interface
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE ASC NULLS LAST Player.order(email.ascNullsLast)
See https://github.com/groue/GRDB.swift/#the-query-interface
Declaration
Swift
@available(macOS 11.0, iOS 14, tvOS 14, watchOS 7, *) public var ascNullsLast: SQLOrdering { get }
-
Returns an ordering suitable for QueryInterfaceRequest.order()
let email: SQLCollatedExpression = Column("email").collating(.nocase) // SELECT * FROM player ORDER BY email COLLATE NOCASE DESC NULLS FIRST Player.order(email.descNullsFirst)
See https://github.com/groue/GRDB.swift/#the-query-interface
Declaration
Swift
@available(macOS 11.0, iOS 14, tvOS 14, watchOS 7, *) public var descNullsFirst: SQLOrdering { get }
-
Declaration
Swift
public var sqlOrdering: SQLOrdering { get }