]> err.no Git - sope/blob - sope-gdl1/PostgreSQL/PostgreSQL72Channel.h
fixed for new -describeResults: API
[sope] / sope-gdl1 / PostgreSQL / PostgreSQL72Channel.h
1 /* 
2    PostgreSQL72Channel.h
3
4    Copyright (C) 1999 MDlink online service center GmbH and Helge Hess
5    Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess
6
7    Author: Helge Hess (helge.hess@opengroupware.org)
8
9    This file is part of the PostgreSQL72 Adaptor Library
10
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Library General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Library General Public License for more details.
20
21    You should have received a copy of the GNU Library General Public
22    License along with this library; see the file COPYING.LIB.
23    If not, write to the Free Software Foundation,
24    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27 #ifndef ___PostgreSQL72_Channel_H___
28 #define ___PostgreSQL72_Channel_H___
29
30 #include <GDLAccess/EOAdaptorChannel.h>
31 #include <libpq-fe.h>
32
33 @class NSArray, NSString, NSMutableDictionary;
34 @class PGConnection, PGResultSet;
35
36 typedef struct {
37   const char *name;
38   Oid        type;
39   int        size;
40   int        modification;
41 } PostgreSQL72FieldInfo;
42
43 @interface PostgreSQL72Channel : EOAdaptorChannel
44 {
45   // connection is valid after an openChannel call
46   PGConnection *connection;
47   
48   // valid during -evaluateExpression:
49   PGResultSet *resultSet;
50   int      tupleCount;
51   int      fieldCount;
52   BOOL     containsBinaryData;
53   PostgreSQL72FieldInfo *fieldInfo;
54   NSString *cmdStatus;
55   NSString *cmdTuples;
56   int      currentTuple;
57
58   // turns on/off channel debugging
59   BOOL isDebuggingEnabled;
60
61   NSMutableDictionary *_attributesForTableName;
62   NSMutableDictionary *_primaryKeysNamesForTableName;
63   
64   int      *fieldIndices;
65   NSString **fieldKeys;
66   id       *fieldValues;
67 }
68
69 - (void)setDebugEnabled:(BOOL)_flag;
70 - (BOOL)isDebugEnabled;
71
72 @end
73
74 @interface NSObject(Sybase10ChannelDelegate)
75
76 - (NSArray*)postgreSQLChannel:(PostgreSQL72Channel *)channel
77   willFetchAttributes:(NSArray *)attributes;
78
79 - (BOOL)postgreSQLChannel:(PostgreSQL72Channel *)channel
80   willReturnRow:(NSDictionary *)row;
81
82 @end
83
84 #endif /* ___PostgreSQL72_Channel_H___ */