Structure
PostgresData
public struct PostgresData: CustomStringConvertible, CustomDebugStringConvertible
Relationships
Conforms To
PostgresDataConvertible
CustomDebugStringConvertible
CustomStringConvertible
ExpressibleByBooleanLiteral
ExpressibleByStringLiteral
Initializers
init(array:)
public init<T>(array: [T])
where T: PostgresDataConvertible
init(array:elementType:)
public init(array: [PostgresData?], elementType: PostgresDataType)
init(bool:)
public init(bool: Bool)
init(booleanLiteral:)
public init(booleanLiteral value: Bool)
init(bytes:)
public init<Bytes>(bytes: Bytes)
where Bytes: Sequence, Bytes.Element == UInt8
init(date:)
public init(date: Date)
init(decimal:)
public init(decimal: Decimal)
init(double:)
public init(double: Double)
init(float:)
public init(float: Float)
init(int:)
public init(int value: Int)
init(uint8:)
public init(uint8 value: UInt8)
init(int16:)
public init(int16 value: Int16)
init(int32:)
public init(int32 value: Int32)
init(int64:)
public init(int64 value: Int64)
init(json:)
public init(json jsonData: Data)
init(json:)
public init<T>(json value: T) throws where T: Encodable
init(jsonb:)
public init(jsonb jsonData: Data)
init(jsonb:)
public init<T>(jsonb value: T) throws where T: Encodable
init(numeric:)
public init(numeric: PostgresNumeric)
init(string:)
public init(string: String)
init(stringLiteral:)
public init(stringLiteral value: String)
init(uuid:)
public init(uuid: UUID)
init(type:typeModifier:formatCode:value:)
public init(type: PostgresDataType, typeModifier: Int32? = nil, formatCode: PostgresFormat = .binary, value: ByteBuffer? = nil)
init?(postgresData:)
public init?(postgresData: PostgresData)
init(uint:)
@available(*, deprecated, renamed: "init(int:)")
public init(uint value: UInt)
init(int8:)
@available(*, deprecated, renamed: "init(uint8:)")
public init(int8 value: Int8)
init(uint16:)
@available(*, deprecated, renamed: "init(int16:)")
public init(uint16 value: UInt16)
init(uint32:)
@available(*, deprecated, renamed: "init(int32:)")
public init(uint32 value: UInt32)
init(uint64:)
@available(*, deprecated, renamed: "init(int64:)")
public init(uint64 value: UInt64)
Properties
array
public var array: [PostgresData]?
bool
public var bool: Bool?
bytes
public var bytes: [UInt8]?
date
public var date: Date?
decimal
public var decimal: Decimal?
double
public var double: Double?
float
public var float: Float?
int
public var int: Int?
uint8
public var uint8: UInt8?
int16
public var int16: Int16?
int32
public var int32: Int32?
int64
public var int64: Int64?
json
public var json: Data?
jsonb
public var jsonb: Data?
numeric
public var numeric: PostgresNumeric?
string
public var string: String?
character
public var character: Character?
uuid
public var uuid: UUID?
null
public static var null: PostgresData
typeModifier
public var typeModifier: Int32?
The type modifier (see pg_attribute.atttypmod). The meaning of the modifier is type-specific.
formatCode
public var formatCode: PostgresFormat
The format code being used for the field. Currently will be zero (text) or one (binary). In a RowDescription returned from the statement variant of Describe, the format code is not yet known and will always be zero.
value
public var value: ByteBuffer?
description
public var description: String
debugDescription
public var debugDescription: String
postgresDataType
public static var postgresDataType: PostgresDataType
postgresData
public var postgresData: PostgresData?
uint
@available(*, deprecated, renamed: "int")
public var uint: UInt?
int8
@available(*, deprecated, renamed: "uint8")
public var int8: Int8?
uint16
@available(*, deprecated, renamed: "int16")
public var uint16: UInt16?
uint32
@available(*, deprecated, renamed: "int32")
public var uint32: UInt32?
uint64
@available(*, deprecated, renamed: "int64")
public var uint64: UInt64?
Methods
array(of:)
public func array<T>(of type: T.Type = T.self) -> [T]?
where T: PostgresDataConvertible
json(as:)
public func json<T>(as type: T.Type) throws -> T? where T: Decodable
jsonb(as:)
public func jsonb<T>(as type: T.Type) throws -> T? where T: Decodable