QueryParameter

public final class QueryParameter

Representation of a parameter to replace a placeholder in a query

  • the type this parameter was requested to be

    Declaration

    Swift

    public let valueType: PGType
  • the number of bytes the value takes up

    Declaration

    Swift

    public let valueCount: Int
  • The caller owns this value and is responsible for calling .deallocate() on it

    Declaration

    Swift

    public var valueBytes: UnsafePointer<Int8> { get }
  • Create a QueryParameter binding

    Throws

    If value is not the appropriate type for valueType

    Declaration

    Swift

    public convenience init(type valueType: PGType, value: Any, connection: Connection) throws

    Parameters

    valueType

    the SQL data type

    value

    the value to bind. Must be the matching NativeType

    connection

    connection this parameter belongs to