perfect.org
Documentation
|
API Documentation
PerfectLib
Perfect-CouchDB
Perfect-CURL
Perfect-Filemaker
Perfect-GoogleAnalytics-MeasurementProtocol
Perfect-HTTP
Perfect-HTTPServer
Perfect-Logger
Perfect-MongoDB
Perfect-Mustache
Perfect-MySQL
Perfect-MariaDB
Perfect-Net
Perfect-Notifications
Perfect-PostgreSQL
Perfect-Redis
Perfect-RequestLogger
Perfect-Session
Perfect-Session-SQLite
Perfect-Session-CouchDB
Perfect-Session-MySQL
Perfect-Session-PostgreSQL
Perfect-SQLite
Perfect-Thread
Perfect-WebSockets
Perfect-XML
Perfect-Zip
Turnstile-Perfect
Perfect-Turnstile-CouchDB
Perfect-Turnstile-MySQL
Perfect-Turnstile-PostgreSQL
Perfect-Turnstile-SQLite
StORM
CouchDB-StORM
MySQL-StORM
Postgres-StORM
SQLite-StORM
Module: Perfect-PostgreSQL
class
PGResult
result object
enum
StatusType
Result Status enum
case
emptyQuery
case
commandOK
case
tuplesOK
case
badResponse
case
nonFatalError
case
fatalError
case
singleTuple
case
unknown
func
close()
close result object
func
clear()
clear and disconnect result object
func
statusInt() -> Int
Result Status number as Int
func
status() -> StatusType
Result Status Value
func
errorMessage() -> String
Result Status Message
func
numFields() -> Int
Result field count
func
fieldName(index: Int) -> String?
Field name for index value
func
fieldType(index: Int) -> Oid?
Field type for index value
func
numTuples() -> Int
number of rows (Tuples) returned in result
func
fieldIsNull(tupleIndex: Int, fieldIndex: Int) -> Bool
test null field at row index for field index
func
getFieldString(tupleIndex: Int, fieldIndex: Int) -> String?
return value for String field type with row and field indexes provided
func
getFieldInt(tupleIndex: Int, fieldIndex: Int) -> Int?
return value for Int field type with row and field indexes provided
func
getFieldBool(tupleIndex: Int, fieldIndex: Int) -> Bool?
return value for Bool field type with row and field indexes provided
func
getFieldInt8(tupleIndex: Int, fieldIndex: Int) -> Int8?
return value for Int8 field type with row and field indexes provided
func
getFieldInt16(tupleIndex: Int, fieldIndex: Int) -> Int16?
return value for Int16 field type with row and field indexes provided
func
getFieldInt32(tupleIndex: Int, fieldIndex: Int) -> Int32?
return value for Int32 field type with row and field indexes provided
func
getFieldInt64(tupleIndex: Int, fieldIndex: Int) -> Int64?
return value for Int64 field type with row and field indexes provided
func
getFieldDouble(tupleIndex: Int, fieldIndex: Int) -> Double?
return value for Double field type with row and field indexes provided
func
getFieldFloat(tupleIndex: Int, fieldIndex: Int) -> Float?
return value for Float field type with row and field indexes provided
func
getFieldBlob(tupleIndex: Int, fieldIndex: Int) -> [Int8]?
return value for Blob field type with row and field indexes provided
class
PGConnection
connection management class
enum
StatusType
Connection Status enum
case
ok
case
bad
func
init()
empty init
func
connectdb(_ info: String) -> StatusType
Makes a new connection to the database server.
func
close()
Close db connection
func
finish()
Closes the connection to the server. Also frees memory used by the PGconn object.
func
status() -> StatusType
Returns the status of the connection.
func
errorMessage() -> String
Returns the error message most recently generated by an operation on the connection.
func
exec(statement: String) -> PGResult
Submits a command to the server and waits for the result.
func
exec(statement: String, params: [Any]) -> PGResult
Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text.