SQLLiteral
public struct SQLLiteralextension SQLLiteral: ExpressibleByStringInterpolationSQLLiteral is a type which support SQL Interpolation.
For example:
try dbQueue.write { db in
    let name: String = ...
    let id: Int64 = ...
    let query: SQLLiteral = "UPDATE player SET name = \(name) WHERE id = \(id)"
    try db.execute(literal: query)
}
- 
                  
                  Creates an SQLLiteral from a plain SQL string, and eventual arguments. For example: let query = SQLLiteral( sql: "UPDATE player SET name = ? WHERE id = ?", arguments: [name, id])DeclarationSwift public init(sql: String, arguments: StatementArguments = StatementArguments())
- 
                  
                  Creates an SQLLiteral from an SQL expression. For example: let columnLiteral = SQLLiteral(Column("username")) let suffixLiteral = SQLLiteral("@example.com".databaseValue) let emailLiteral = [columnLiteral, suffixLiteral].joined(separator: " || ") let request = User.select(emailLiteral.sqlExpression) let emails = try String.fetchAll(db, request)DeclarationSwift public init(_ expression: SQLExpression)
- 
                  
                  Returns true if this literal generates an empty SQL string DeclarationSwift public var isEmpty: Bool { get }
- 
                  
                  Turn a SQLLiteral into raw SQL and arguments. DeclarationSwift public func build(_ db: Database) throws -> (sql: String, arguments: StatementArguments)ParametersdbA database connection. Return ValueA tuple made of a raw SQL string, and statement arguments. 
- 
                  
                  Returns the SQLLiteral produced by the concatenation of two literals. let name = "O'Brien" let selection: SQLLiteral = "SELECT * FROM player " let condition: SQLLiteral = "WHERE name = \(name)" let query = selection + conditionDeclarationSwift public static func + (lhs: SQLLiteral, rhs: SQLLiteral) -> SQLLiteral
- 
                  
                  Appends an SQLLiteral to the receiver. let name = "O'Brien" var query: SQLLiteral = "SELECT * FROM player " query += "WHERE name = \(name)"DeclarationSwift public static func += (lhs: inout SQLLiteral, rhs: SQLLiteral)
- 
                  
                  Appends an SQLLiteral to the receiver. let name = "O'Brien" var query: SQLLiteral = "SELECT * FROM player " query.append(literal: "WHERE name = \(name)")DeclarationSwift public mutating func append(literal sqlLiteral: SQLLiteral)
- 
                  
                  Appends a plain SQL string to the receiver, and eventual arguments. let name = "O'Brien" var query: SQLLiteral = "SELECT * FROM player " query.append(sql: "WHERE name = ?", arguments: [name])DeclarationSwift public mutating func append(sql: String, arguments: StatementArguments = StatementArguments())
- 
                  
                  Creates a literal SQL expression. SQLLiteral(sql: "1 + 2").sqlExpression SQLLiteral(sql: "? + ?", arguments: [1, 2]).sqlExpression SQLLiteral(sql: ":one + :two", arguments: ["one": 1, "two": 2]).sqlExpressionDeclarationSwift public var sqlExpression: SQLExpression { get }
- 
                  
                  :nodoc DeclarationSwift public init(unicodeScalarLiteral: String)
 View on GitHub
View on GitHub Install in Dash
Install in Dash SQLLiteral Structure Reference
        SQLLiteral Structure Reference