ObjPgSQL  Check-in [b80a03bd2f]

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: b80a03bd2fd4ff11dc0d9c7ce330695ebc060f78034b9ade2d7eb53d88c7bb80
User & Date: js on 2016-02-21 11:08:17
Other Links: manifest | tags
Context
2017-01-22
04:41
Update buildsys check-in: e5ac3ed936 user: js tags: trunk
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
Changes

Modified src/PGConnection.h from [37db765c44] to [68ece51d08].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1
2
3
4
5
6
7
8
9
10
11
12

13

14


15
16
17
18
19
20
21












-

-

-
-







#include <libpq-fe.h>

#import <ObjFW/ObjFW.h>

#import "PGResult.h"

@interface PGConnection: OFObject
{
	PGconn *_connnection;
	OFDictionary *_parameters;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFDictionary *parameters;
#endif

- (void)setParameters: (OFDictionary*)parameters;
- (OFDictionary*)parameters;
- (void)connect;
- (void)reset;
- (void)close;
- (PGResult*)executeCommand: (OFConstantString*)command;
- (PGResult*)executeCommand: (OFConstantString*)command
		 parameters: (id)firstParameter, ... OF_SENTINEL;
- (PGconn*)PG_connection;

Modified src/PGConnection.m from [85877956d2] to [66118a42be].

1
2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17










18
19
20
21
22
23
24






+
+









-
-
-
-
-
-
-
-
-
-







#import "PGConnection.h"

#import "PGConnectionFailedException.h"
#import "PGCommandFailedException.h"

@implementation PGConnection
@synthesize parameters = _parameters;

- (void)dealloc
{
	[_parameters release];

	[self close];

	[super dealloc];
}

- (void)setParameters: (OFDictionary*)parameters
{
	OF_SETTER(_parameters, parameters, YES, YES)
}

- (OFDictionary*)parameters
{
	OF_GETTER(_parameters, YES)
}

- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFEnumerator *keyEnumerator = [_parameters keyEnumerator];
	OFEnumerator *objectEnumerator = [_parameters objectEnumerator];
	OFMutableString *connectionInfo = nil;
	OFString *key, *object;

Modified src/exceptions/PGCommandFailedException.h from [4d78dea5a5] to [c0757cbfd8].

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17
1
2
3
4
5
6
7


8

9
10
11
12
13

14







-
-
+
-





-

#import "PGException.h"

@interface PGCommandFailedException: PGException
{
	OFString *_command;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, copy, nonatomic) OFString *command;
@property (readonly, copy) OFString *command;
#endif

+ (instancetype)exceptionWithConnection: (PGConnection*)connection
				command: (OFString*)command;
- initWithConnection: (PGConnection*)connection
	     command: (OFString*)command;
- (OFString*)command;
@end

Modified src/exceptions/PGCommandFailedException.m from [2780d9067f] to [7e22faf8ff].

1
2
3


4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
11
12



+
+







#import "PGCommandFailedException.h"

@implementation PGCommandFailedException
@synthesize command = _command;

+ (instancetype)exceptionWithConnection: (PGConnection*)connection
				command: (OFString*)command
{
	return [[[self alloc] initWithConnection: connection
					 command: command] autorelease];
}

31
32
33
34
35
36
37
38
39
40
41
42
43
33
34
35
36
37
38
39





40







-
-
-
-
-

}

- (OFString*)description
{
	return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
					   @"Command: %@", _error, _command];
}

- (OFString*)command
{
	OF_GETTER(_command, NO)
}
@end

Modified src/exceptions/PGException.h from [9572250036] to [f5eecc1954].

1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
1
2
3
4
5
6
7
8
9
10


11

12
13
14

15










-
-
+
-



-

#import <ObjFW/ObjFW.h>

#import "PGConnection.h"

@interface PGException: OFException
{
	PGConnection *_connection;
	OFString *_error;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, retain, nonatomic) PGConnection *connection;
@property (readonly, retain) PGConnection *connection;
#endif

+ (instancetype)exceptionWithConnection: (PGConnection*)connection;
- initWithConnection: (PGConnection*)connection;
- (PGConnection*)connection;
@end

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

1
2
3


4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
11
12



+
+







#import "PGException.h"

@implementation PGException
@synthesize connection = _connection;

+ (instancetype)exceptionWithConnection: (PGConnection*)connection
{
	return [[[self alloc] initWithConnection: connection] autorelease];
}

- initWithConnection: (PGConnection*)connection
{
32
33
34
35
36
37
38
39
40
41
42
43
44
34
35
36
37
38
39
40





41







-
-
-
-
-

}

- (OFString*)description
{
	return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@",
					   _error];
}

- (PGConnection*)connection
{
	OF_GETTER(_connection, NO)
}
@end