]> err.no Git - sope/blob - sope-gdl1/SQLite3/SQLiteChannel.h
fixed fetch issue
[sope] / sope-gdl1 / SQLite3 / SQLiteChannel.h
1 /* 
2    SQLiteChannel.h
3
4    Copyright (C) 2003-2005 Helge Hess
5
6    Author: Helge Hess (helge.hess@opengroupware.org)
7
8    This file is part of the SQLite Adaptor Library
9
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Library General Public
12    License as published by the Free Software Foundation; either
13    version 2 of the License, or (at your option) any later version.
14
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Library General Public License for more details.
19
20    You should have received a copy of the GNU Library General Public
21    License along with this library; see the file COPYING.LIB.
22    If not, write to the Free Software Foundation,
23    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25
26 #ifndef ___SQLite_Channel_H___
27 #define ___SQLite_Channel_H___
28
29 #import <GDLAccess/EOAdaptorChannel.h>
30 #include <sqlite3.h>
31
32 @class NSArray, NSString, NSMutableDictionary;
33
34 @interface SQLiteChannel : EOAdaptorChannel
35 {
36   // connection is valid after an openChannel call
37   void *_connection;
38   
39   // valid during -evaluateExpression:
40   void     *statement;
41   BOOL     hasPendingRow;
42   BOOL     isDone;
43   
44   void     *results;
45 #if 0
46   int      tupleCount;
47   int      fieldCount;
48   BOOL     containsBinaryData;
49   NSString *cmdStatus;
50   NSString *cmdTuples;
51   NSString *oidStatus;
52   int      currentTuple;
53 #endif
54
55   // turns on/off channel debugging
56   BOOL isDebuggingEnabled;
57
58   NSMutableDictionary *_attributesForTableName;
59   NSMutableDictionary *_primaryKeysNamesForTableName;
60 }
61
62 - (void)setDebugEnabled:(BOOL)_flag;
63 - (BOOL)isDebugEnabled;
64
65 - (BOOL)isOpen;
66 - (BOOL)openChannel;
67 - (void)closeChannel;
68
69 - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes
70   withZone:(NSZone *)_zone;
71
72 - (BOOL)evaluateExpression:(NSString *)_expression;
73
74 // cancelFetch is always called to terminate a fetch
75 // (even by primaryFetchAttributes)
76 // it frees all fetch-local variables
77 - (void)cancelFetch;
78
79 // uses dataFormat type information to create EOAttribute objects
80 - (NSArray *)describeResults;
81
82 @end
83
84 @interface NSObject(Sybase10ChannelDelegate)
85
86 - (NSArray*)sqlite3Channel:(SQLiteChannel *)channel
87   willFetchAttributes:(NSArray *)attributes;
88
89 - (BOOL)sqlite3Channel:(SQLiteChannel *)channel
90   willReturnRow:(NSDictionary *)row;
91
92 @end
93
94 #endif /* ___SQLite_Channel_H___ */