SQLSpecificExpressible

public protocol SQLSpecificExpressible : SQLExpressible

Experimental

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 (via DatabaseValueConvertible).

  • capitalized Extension method

    Returns an SQL expression that applies the Swift’s built-in capitalized String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.capitalized)
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var capitalized: SQLExpression
  • lowercased Extension method

    Returns an SQL expression that applies the Swift’s built-in lowercased String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.lowercased())
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var lowercased: SQLExpression
  • uppercased Extension method

    Returns an SQL expression that applies the Swift’s built-in uppercased String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.uppercased())
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var uppercased: SQLExpression
  • localizedCapitalized Extension method

    Returns an SQL expression that applies the Swift’s built-in localizedCapitalized String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.localizedCapitalized)
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var localizedCapitalized: SQLExpression
  • localizedLowercased Extension method

    Returns an SQL expression that applies the Swift’s built-in localizedLowercased String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.localizedLowercased)
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var localizedLowercased: SQLExpression
  • localizedUppercased Extension method

    Returns an SQL expression that applies the Swift’s built-in localizedUppercased String property. It is NULL for non-String arguments.

    let nameColumn = Column("name")
    let request = Player.select(nameColumn.localizedUppercased)
    let names = try String.fetchAll(dbQueue, request)   // [String]
    

    Declaration

    Swift

    public var localizedUppercased: SQLExpression