diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-05-23 01:04:07 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-05-23 01:04:07 +0000 |
commit | b14c99d8d6bdb3155fe54e6f24e8aac32a09ed81 (patch) | |
tree | 0b63fc00dfff28c643cfafe587777ab11e5733c5 /src/interfaces/libpq++/pgdatabase.h | |
parent | 795f6ca66ab734559e6eed7a9466eb19b58f3166 (diff) | |
download | postgresql-b14c99d8d6bdb3155fe54e6f24e8aac32a09ed81.tar.gz postgresql-b14c99d8d6bdb3155fe54e6f24e8aac32a09ed81.zip |
Here it is. Remove or rename the current interfaces/libpq++ and untar
this file in interfaces/
It will all need to be checked in. I used the char *rcsid[] method for
cvs ids so it can be strings | grep'd to find version numbers. The new
version for the library is 3.0.
Run configure from src/ to create the Makefile and it should be good to
go.
I did minimal documentation references in the README, I'll see if I can
get something to Tom Lockhart rather quickly.
Vince.
Diffstat (limited to 'src/interfaces/libpq++/pgdatabase.h')
-rw-r--r-- | src/interfaces/libpq++/pgdatabase.h | 67 |
1 files changed, 25 insertions, 42 deletions
diff --git a/src/interfaces/libpq++/pgdatabase.h b/src/interfaces/libpq++/pgdatabase.h index c3c904234c1..d529f5bae22 100644 --- a/src/interfaces/libpq++/pgdatabase.h +++ b/src/interfaces/libpq++/pgdatabase.h @@ -12,6 +12,9 @@ * * Copyright (c) 1994, Regents of the University of California * + * + * $Id: pgdatabase.h,v 1.2 1999/05/23 01:04:01 momjian Exp $ + * *------------------------------------------------------------------------- */ @@ -31,52 +34,32 @@ // results are being received. class PgDatabase : public PgConnection { public: - PgDatabase(const char* dbName) : PgConnection(dbName) {} // use reasonable defaults - // connect to the database with given environment and database name - PgDatabase(const PgEnv& env, const char* dbName) : PgConnection(env, dbName) {} - PgDatabase(const PgConnection& conn) : PgConnection(conn) {pgCloseConnection = 0;} - ~PgDatabase() {} // close connection and clean up + PgDatabase(const char* conninfo) : PgConnection(conninfo) {} // use reasonable defaults + ~PgDatabase() {} ; // close connection and clean up // query result access - int Tuples() - { return PQntuples(pgResult); } - int Fields() - { return PQnfields(pgResult); } - const char* FieldName(int field_num) - { return PQfname(pgResult, field_num); } - int FieldNum(const char* field_name) - { return PQfnumber(pgResult, field_name); } - Oid FieldType(int field_num) - { return PQftype(pgResult, field_num); } - Oid FieldType(const char* field_name) - { return PQftype(pgResult, FieldNum(field_name)); } - short FieldSize(int field_num) - { return PQfsize(pgResult, field_num); } - short FieldSize(const char* field_name) - { return PQfsize(pgResult, FieldNum(field_name)); } - const char* GetValue(int tup_num, int field_num) - { return PQgetvalue(pgResult, tup_num, field_num); } - const char* GetValue(int tup_num, const char* field_name) - { return PQgetvalue(pgResult, tup_num, FieldNum(field_name)); } - int GetLength(int tup_num, int field_num) - { return PQgetlength(pgResult, tup_num, field_num); } - int GetLength(int tup_num, const char* field_name) - { return PQgetlength(pgResult, tup_num, FieldNum(field_name)); } - void DisplayTuples(FILE *out = 0, int fillAlign = 1, const char* fieldSep = "|", - int printHeader = 1, int quiet = 0) - { PQdisplayTuples(pgResult, (out ? out : stdout), fillAlign, fieldSep, printHeader, quiet); } - void PrintTuples(FILE *out = 0, int printAttName = 1, int terseOutput = 0, int width = 0) - { PQprintTuples(pgResult, (out ? out : stdout), printAttName, terseOutput, width); } + int Tuples(); + int Fields(); + const char* FieldName(int field_num); + int FieldNum(const char* field_name); + Oid FieldType(int field_num); + Oid FieldType(const char* field_name); + short FieldSize(int field_num); + short FieldSize(const char* field_name); + const char* GetValue(int tup_num, int field_num); + const char* GetValue(int tup_num, const char* field_name); + int GetLength(int tup_num, int field_num); + int GetLength(int tup_num, const char* field_name); + void DisplayTuples(FILE *out = 0, int fillAlign = 1, + const char* fieldSep = "|",int printHeader = 1, int quiet = 0) ; + void PrintTuples(FILE *out = 0, int printAttName = 1, + int terseOutput = 0, int width = 0) ; // copy command related access - int GetLine(char* string, int length) - { return PQgetline(pgConn, string, length); } - void PutLine(const char* string) - { PQputline(pgConn, string); } - const char* OidStatus() - { return PQoidStatus(pgResult); } - int EndCopy() - { return PQendcopy(pgConn); } + int GetLine(char* string, int length); + void PutLine(const char* string); + const char* OidStatus(); + int EndCopy(); protected: PgDatabase() : PgConnection() {} // Do not connect |