︙ | | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
+
|
#import "PGResult.h"
#import "PGResult+Private.h"
#import "PGConnectionFailedException.h"
#import "PGCommandFailedException.h"
@implementation PGConnection
@synthesize pg_connection = _connection;
@synthesize parameters = _parameters;
- (void)dealloc
{
[_parameters release];
[self close];
|
︙ | | |
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
-
+
|
@throw [PGCommandFailedException
exceptionWithConnection: self
command: command];
}
switch (PQresultStatus(result)) {
case PGRES_TUPLES_OK:
return [PGResult PG_resultWithResult: result];
return [PGResult pg_resultWithResult: result];
case PGRES_COMMAND_OK:
PQclear(result);
return nil;
default:
PQclear(result);
@throw [PGCommandFailedException
exceptionWithConnection: self
|
︙ | | |
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
-
+
|
[self freeMemory: values];
}
objc_autoreleasePoolPop(pool);
switch (PQresultStatus(result)) {
case PGRES_TUPLES_OK:
return [PGResult PG_resultWithResult: result];
return [PGResult pg_resultWithResult: result];
case PGRES_COMMAND_OK:
PQclear(result);
return nil;
default:
PQclear(result);
@throw [PGCommandFailedException
exceptionWithConnection: self
|
︙ | | |
241
242
243
244
245
246
247
248
249
250
251
252
253
|
242
243
244
245
246
247
248
249
|
-
-
-
-
-
|
- (void)insertRows: (OFArray OF_GENERIC(OFDictionary *) *)rows
intoTable: (OFString *)table
{
for (OFDictionary *row in rows)
[self insertRow: row
intoTable: table];
}
- (PGconn *)PG_connection
{
return _connection;
}
@end
|