_rowid BIGSERIAL NOT NULL UNIQUE PRIMARY KEY
LISTEN
(and UNLISTEN
to disable a notification)
to register a PgSQLListener object that will be called
by an NSTimer at a user specified interval, if a PostgreSQL
notification is detected at that time, the pgSQLNotify method
(defined in PgSQLListener protocol) of a user specified object
will be called.
"NOT_SUPPORTED_BY_POSTGRESQL"
)- (void)afterLastRow;
Result: YES if data is available ([conn nextRow] will not block).- (BOOL)asyncResultAvailable;
Result: backend process id.- (int)backendPID;
- (BOOL)beginTransaction;
DOES NOTHING (and returns YES) IN DEMO VERSION.
Result: YES if successful- (void)bindBIT:(BOOLARRAY *)var;
var should point on 6 bytes memory area
- (void)bindBIT:(BOOLARRAY *)var column:(int)col;
var should point on 6 bytes memory area
- (void)bindBinary:(Oid *)var column:(int)col;
- (void)bindBinary:(Oid *)var;
- (void)bindBinaryString:(BSTRING *)var;
- (void)bindBinaryString:(BSTRING *)var column:(int)col;
- (void)bindBoolean:(BOOL *)var column:(int)col;
- (void)bindBoolean:(BOOL *)var;
Y,y,t,T,1 are converted to YES, any other character to NO
- (void)bindBox:(BOX *)var;
- (void)bindBox:(BOX *)var column:(int)col;
- (void)bindCIdr:(unsigned char *)var column:(int)col;
var should point on 12 bytes memory area
- (void)bindCIdr:(unsigned char *)var;
var should point on 12 bytes memory area
- (void)bindChar:(char *)var;
- (void)bindChar:(char *)var column:(int)col;
- (void)bindCircle:(CIRCLE *)var column:(int)col;
- (void)bindCircle:(CIRCLE *)var;
var
to the next result column.
- (void)bindDouble:(double *)var;
var
to the specific column col
. (column count starts at 0)
- (void)bindDouble:(double *)var column:(int)col;
In case you skip columns in binding, they will be binded internally to a dummy item in order to avoid crashes or erroneous behavior.
- (void)bindFloat:(float *)var;
- (void)bindFloat:(float *)var column:(int)col;
- (void)bindInet:(unsigned char *)var;
var should point on 12 bytes memory area
- (void)bindInet:(unsigned char *)var column:(int)col;
var should point on 12 bytes memory area
- (void)bindInteger:(int *)var;
- (void)bindInteger:(int *)var column:(int)col;
- (void)bindLSeg:(LSEG *)var;
*var should be deallocated by free(*var) to avoid memory leaks
- (void)bindLSeg:(LSEG *)var column:(int)col;
- (void)bindLine:(LINE *)var column:(int)col;
- (void)bindLine:(LINE *)var;
*var should be deallocated by free(*var) to avoid memory leaks
- (void)bindLong:(long *)var;
- (void)bindLong:(long *)var column:(int)col;
- (void)bindLongLong:(long long *)var;
- (void)bindLongLong:(long long *)var column:(int)col;
- (void)bindMACaddr:(unsigned char *)var;
var should point on 6 bytes memory area
- (void)bindMACaddr:(unsigned char *)var column:(int)col;
var should point on 6 bytes memory area
- (void)bindPath:(PATH **)var column:(int)col;
- (void)bindPath:(PATH **)var;
- (void)bindPoint:(POINT *)var;
*var should be deallocated by free(*var) to avoid memeory leaks
- (void)bindPoint:(POINT *)var column:(int)col;
- (void)bindPolygon:(POLYGON **)var column:(int)col;
- (void)bindPolygon:(POLYGON **)var;
- (void)bindShort:(short *)var;
- (void)bindShort:(short *)var column:(int)col;
- (void)bindString:(char *)var;
- (void)bindString:(char *)var column:(int)col;
- (void)bindText:(TEXT *)var;
- (void)bindText:(TEXT *)var column:(int)col;
Result: YES if command buffer contains not yet executed string.- (BOOL)bufferHasCommands;
- (BOOL)cancelRequest;
- (void)clearCommands;
Result: client encoding id.- (int)clientEncoding;
- (BOOL)closeCursor:(const char *)cursorName;
Result: YES if successful.
Name Description cursorName
Result: pointer on command buffer- (const char *)commandBuffer;
- (BOOL)connectAskingUser:(int *)returnCode;
Result: YES if connection successfull, NO otherwise.
Name Description pointer an integer buffer o hold result code from backend.
- (const char *)connectErrorMessage:(int)errorCode;
Result: PQresStatus(errorCode)
Name Description errorCode to be converted into string.
- (BOOL)connectToDatabase:(const char *)dbName onHost:(const char *)hostName login:(const char *)loginName password:(const char *)password return:(int *)returnCode;
The wrapper is disconnected from any opened database before establishing a new one.
Passing nil or empty string to any of the parameters will fail.
Use (BOOL)connectToDatabase:(const char *)connectInfo return:(int *)returnCode
if you need to pass different arguments like options or tty or if you want to use less arguments and let PostgreSQL use default ones.
Result: YES if connection successful No otherwise
Name Description dbName databasename as defined in PostgreSQL. hostName network name of host computer loginName user name for login password user password for login returnCode where to return int result code for connection
- (BOOL)connectToDatabase:(const char *)connectInfo return:(int *)returnCode;
Result: YES if connection successfull, NO otherwise.
Name Description connectInfo character buffer holding the conenction string to be used. return pointer an integer buffer o hold result code from backend.
Result: pointer on database name string buffer.- (const char *)databaseName;
- (id)delegate;
- (void)disconnect;
Not strictly necessary in the API since connectTodatabase disconnects automatically from any previously opened connection.
- (BOOL)endTransaction;
DOES NOTHING (and returns YES) IN DEMO VERSION.
Result: YES if successfulResult: nil if out of memory- (NSData *)escapeBinary:(const unsigned char *)inSource length:(size_t)len;
Result: nil if out of memory- (NSString *)escapeString:(const char *)inSource;
Result: YES if successful- (BOOL)executeAsyncCommand;
- (BOOL)executeAsyncCommandWithCursor:(const char *)cursorName binary:(BOOL)binary;
Result: YES if successful
Name Description cursorName the name of the cursor binary if cursor should be declared BINARY
Result: YES if successful- (BOOL)executeCommand;
- (BOOL)executeCommandWithCursor:(const char *)cursorName binary:(BOOL)binary;
Result: YES if successful
Name Description cursorName the name of the cursor binary if cursor should be declared BINARY
Result: the lo_export returned code.- (int)exportBinaryToFile:(Oid)inOid pathName:(const char *)inPathName;
Result: NSString describing the framework version.- (NSString *)frameworkVersion;
- (PGconn *)getPGconn;
ALWAYS returns NIL in DEMO version. See PostgreSQL for advanced use.
You should never close yourselve a connection by calling PQfinish([pgconn getPGconn]).
Result: pointer on host name string buffer.- (const char *)hostName;
Result: the Oid of the created BLOB, 0 if an error occurred.- (Oid)importBinaryFromFile:(const char *)inPathName;
- (Oid)insertBinary:(unsigned char *)inData size:(int)size;
Result: the Oid of the created BLOB, 0 if an error occurred.
Name Description inData pointer on the memory buffer size of the memory buffer
Result: the Oid of the created BLOB, 0 if an error occurred.- (Oid)insertBinaryFromData:(NSData *)inData;
- (Oid)insertBinaryFromFile:(NSFileHandle *)inFile;
Result: the Oid of the created BLOB, 0 if an error occurred.
Name Description the NSFileHandle on the file.
Result: YES if column at- (BOOL)isColumnNULL:(int)fieldIndex;
fieldIndex
is NULL
Result: pointer on user name string buffer.- (const char *)loginName;
cmd
to current command buffer
- (void)makeCommand:(char *)cmd;
makeCommand family methods don't escape automatically their arguments
Use escapeString if you need to.
- (void)makeCommandf:(const char *)format, ...;
- (BOOL)nextRow;
Result: pointer on options string buffer.- (const char *)options;
Result: YES if successful (number of bytes written == size of NSData buffer).- (BOOL)overWriteBinaryWithDataFromStart:(Oid)inOid data:(NSData *)inData start:(int)inStart;
Result: pointer on password string buffer.- (const char *)password;
Result: pointer on port string buffer.- (const char *)port;
- (NSString *)postgreSQLVersion;
returns reulst of executing the SELECT version()
query.
- (BOOL)previousRow;
- (void)removeNotificationFor:(PgSQLListener *)listener;
- (NSDictionary *)resultAsDictionary;
resultAsDictionnary returns a dictionary structured as follows
<dict>
<key>columns/key>
<array>
<dict>
<key>name</key>
<string>columnTitle</string>
<key>typeName</key>
<string>columnTypeName</string>
<key>typeOid</key>
<integer>columnTypeOid</integer>
</dict>
...
</array>
<key>fields/key>
<array>
<string>columnFieldValue</string>
...
</array>
Since PostgreSQL allows creation of new types, we don't provide yet
an automatic conversion from the PostgreSQL type to the plist one.
curRowIndex
used by nextRow
and previousRow
methodswhile ([psql nextRow]) {
...
}
Result: the number of columns of latest executed command.- (int)resultColumnCount;
Result: the name of the column at index col.- (const char *)resultColumnName:(int)col;
Result: the type oid of the column at index col.- (Oid)resultColumnType:(int)col;
Result: the name of the type of the column at index col.- (const char *)resultColumnTypeName:(int)col;
Result: YES if latest command executed returns rows.- (BOOL)resultReturned;
col
in latest result.Result: "NOT_SUPPORTED_BY_POSTGRESQL"- (const char *)resultTableName:(int)col;
- (NSData *)retrieveBinary:(Oid)inOid;
Result: NSData object or nil.
Name Description the Oid of the BLOB to be retrieved.
- (NSData *)retrieveBinaryFromStartLength:(Oid)inOid start:(int)inStart length:(int)length;
Result: NSData object or nil.
Name Description the Oid of the BLOB to be retrieved. start position from which to retrieve data length number of bytes to retrieve.
- (BOOL)rollbackTransaction;
DOES NOTHING (and returns YES) IN DEMO VERSION.
Result: YES if successful- (int)rowsAffected;
Result: PQerrorMessage()- (const char *)serverMessage;
- (int)setClientEncoding:(const char *)encoding;
Name Description encoding name
+ (void)setDebug:(BOOL)yn;
Newly allocated PostgreSQL objects have their instance debug flag set the the global one.
Name Description yn as you expect.
- (void)setDebugMode:(BOOL)turnOn;
Name Description turnOn as you expect.
- (void)setDelegate:(id)newDelegate;
Result: socket number.- (int)socket;
- (PgSQLListener *)startNotificationFor:(const char *)inTableName delegate:(id)notificatonDelegate userInfo:(id)userInfo;
- (BOOL)startTracing:(const char *)traceFileName;
Result: YES if successfull
Name Description traceFileName full path name of file to dump tracing information.
- (void)stopTracing;
Result: YES if a transaction is in progress (beginTransaction has been called)- (BOOL)transactionInProgress;
Result: pointer on tty string buffer.- (const char *)tty;
- (NSData *)unescapeBinary:(const unsigned char *)inSource length:(size_t)len;
supported in 7.3
Result: nil if out of memoryResult: unique id string.- (NSString *)uniqueID;
_rowid bigserial NOT NULL PRIMARY KEY
Result: the column value as a string.- (const char *)uniqueRowIdForTable:(const char *)tableName;
SELECT max(colName)+1 FROM tableName
Result: the column value as a string.- (const char *)uniqueRowIdForTable:(const char *)tableName column:(const char *)colName;
Result: result code from lo_unlink- (int)unlinkBinary:(Oid)inOid;
NSString *PgSQLColumnsKeyField ;
key for columns array
NSString *PgSQLNameKeyField ;
NSString *PgSQLRowsKeyField ;
NSString *PgSQLTypeKeyField ;
NSString *PgSQLTypeNameKeyField ;
NSString *PgSQLconditionNotificationField ;
NSString *PgSQLconnectionNotificationField ;
NSString *PgSQLuserInfoNotificationField ;
NSString *PostgreSQLNotification ;
NSString *PostgreSQLResultAvailable ;
(Last Updated 12/27/2002)