PGResult
public class PGResultEncapsulates the server response from executing a query
- 
                  
                  the status returned from the server DeclarationSwift public let status: Status
- 
                  
                  true if the result was .commandkOk, .tuplesOk, or .signleTupe DeclarationSwift public var wasSuccessful: Bool { get }
- 
                  
                  the server’s description of the status DeclarationSwift public var statusMessage: String { get }
- 
                  
                  the error message associated with these results DeclarationSwift public var errorMessage: String { get }
- 
                  
                  the number of rows returned DeclarationSwift public var rowCount: Int { get }
- 
                  
                  the number of columns returned DeclarationSwift public var columnCount: Int { get }
- 
                  
                  true if the status indicates data was returned DeclarationSwift public var returnedData: Bool { get }
- 
                  
                  for non-select queries (such as insert/update/deletee) the number of rows affected DeclarationSwift public var rowsAffected: Int { get }
- 
                  
                  if a single row was inserted, the Oid of that row. Returns -1 of there is no value DeclarationSwift public var insertedOid: Int { get }
- 
                  
                  names of columns indexed by column number DeclarationSwift public let columnNames: [String]
- 
                  
                  the type of the column DeclarationSwift public let columnTypes: [PGType]
- 
                  
                  returns the value as the actual native type (String, Int, Bool, etc.) Throws if any parameter is invalid, if the column’s NativeType doesn’t match TDeclarationSwift public func getValue<T>(row: Int, column: Int) throws -> T?Parametersrowrow number columncolumn number Return Valuethe value 
- 
                  
                  finds the index of the first column matching columnName then calls getValue(from:column:) with it Throws if any parameter is invalid, if there is no column with the specified name, or if the column’s NativeType doesn’t match TDeclarationSwift public func getValue<T>(row: Int, columnName: String) throws -> T?Parametersrowrow number columnNamecolumn name Return Valuethe value 
- 
                  
                  Gets the specified value as a data object. Throws if an invalid column numberDeclarationSwift public func getDataValue(row: Int, column: Int) throws -> Data?Parametersrowrow number columncolumn number Return Valuethe value as a string, or nil if NULL 
- 
                  
                  Gets the specified value as a string. This works for more types than nativeType.string Throws if value not easily convertible to a string, or if an invalid column numberDeclarationSwift public func getStringValue(row: Int, column: Int) throws -> String?Parametersrowrow number columncolumn number Return Valuethe value as a string, or nil if NULL 
- 
                  
                  Gets the specified value as a bool if nativeType is .bool Throws if value not a bool, or if an invalid column numberDeclarationSwift public func getBoolValue(row: Int, column: Int) throws -> Bool?Parametersrowrow number columncolumn number Return Valuethe value as a Bool, or nil if NULL 
- 
                  
                  Gets the specified value as a date if columnType.nativeType == .date Throws if native format is not a date, or if an invalid column numberDeclarationSwift public func getDateValue(row: Int, column: Int) throws -> Date?Parametersrowrow number columncolumn number Return Valuethe value as a date, or nil if NULL 
- 
                  
                  Gets the specified value as an integer if columnType.nativeType == .int Throws if native format is not an integer, or if an invalid column numberDeclarationSwift public func getIntValue(row: Int, column: Int) throws -> Int?Parametersrowrow number columncolumn number Return Valuethe value as an integer, or nil if NULL 
- 
                  
                  Gets the specified value as a float if columnType.nativeType == .float Throws if native format is not float, or if an invalid column numberDeclarationSwift public func getFloatValue(row: Int, column: Int) throws -> Float?Parametersrowrow number columncolumn number Return Valuethe value as a float, or nil if NULL 
- 
                  
                  Gets the specified value as a double if columnType.nativeType == .double or .float Throws if native format is not an double or float, or if an invalid column numberDeclarationSwift public func getDoubleValue(row: Int, column: Int) throws -> Double?Parametersrowrow number columncolumn number Return Valuethe value as a double, or nil if NULL 
 View on GitHub
View on GitHub PGResult Class Reference
        PGResult Class Reference