ObjPgSQL  Check-in [8af0a7a766]

Overview
Comment:Adjust to ObjFW changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8af0a7a7662306b2875fc35b6656b24794e624be5b995b2b42fa88a2bac0a220
User & Date: js on 2015-09-06 16:17:11
Other Links: manifest | tags
Context
2016-02-21
11:08
Adjust to ObjFW changes check-in: b80a03bd2f user: js tags: trunk
2015-09-06
16:17
Adjust to ObjFW changes check-in: 8af0a7a766 user: js tags: trunk
2014-07-18
23:35
tests: Get username from environment check-in: 4c1432632b user: js tags: trunk
Changes

Modified src/PGResultRow.m from [bc24366b2f] to [1fee8156f8].

187
188
189
190
191
192
193


194
195
196
197
198
199
200
201
202
203
204



205
206
	return [OFString stringWithUTF8String: PQfname(_res, _pos++)];
}
@end

@implementation PGResultRowObjectEnumerator
- (id)nextObject
{


	if (_pos >= _count)
		return nil;

	while (_pos < _count && PQgetisnull(_res, _row, _pos))
		_pos++;

	if (_pos >= _count)
		return nil;

	return convertType(_res, _pos,
	    [OFString stringWithUTF8String: PQgetvalue(_res, _row, _pos++)]);



}
@end







>
>









|
|
>
>
>


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
	return [OFString stringWithUTF8String: PQfname(_res, _pos++)];
}
@end

@implementation PGResultRowObjectEnumerator
- (id)nextObject
{
	id object;

	if (_pos >= _count)
		return nil;

	while (_pos < _count && PQgetisnull(_res, _row, _pos))
		_pos++;

	if (_pos >= _count)
		return nil;

	object = convertType(_res, _pos,
	    [OFString stringWithUTF8String: PQgetvalue(_res, _row, _pos)]);
	_pos++;

	return object;
}
@end

Modified src/exceptions/PGException.m from [4cb1491070] to [4f6df79034].

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
	self = [super init];

	@try {
		_connection = [connection retain];
		_error = [[OFString alloc]
		    initWithCString: PQerrorMessage([_connection PG_connection])
			   encoding: [OFString nativeOSEncoding]];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
	self = [super init];

	@try {
		_connection = [connection retain];
		_error = [[OFString alloc]
		    initWithCString: PQerrorMessage([_connection PG_connection])
			   encoding: [OFSystemInfo native8BitEncoding]];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}