SQLSpecificExpressible

public protocol SQLSpecificExpressible : SQLExpressible, SQLOrderingTerm, SQLSelectable

SQLSpecificExpressible is a protocol for all database-specific types that can be turned into an SQL expression. Types whose existence is not purely dedicated to the database should adopt the SQLExpressible protocol instead.

For example, Column is a type that only exists to help you build requests, and it adopts SQLSpecificExpressible.

On the other side, Int adopts SQLExpressible.

SQLExpressible

SQL Ordering Support

SQL Collations Support

Like Operator

  • like(_:escape:) Extension method

    An SQL expression with the LIKE SQL operator.

    // email LIKE '%@example.com"
    Column("email").like("%@example.com")
    
    // title LIKE '%10\%%' ESCAPE '\'
    Column("title").like("%10\\%%", escape: "\\")
    

    Declaration

    Swift

    public func like(_ pattern: SQLExpressible, escape: SQLExpressible? = nil) -> SQLExpression