Adjust to ObjFW changes
FossilOrigin-Name: b80a03bd2fd4ff11dc0d9c7ce330695ebc060f78034b9ade2d7eb53d88c7bb80
This commit is contained in:
parent
f9d637e7be
commit
3c16f110f5
6 changed files with 8 additions and 32 deletions
|
@ -10,12 +10,8 @@
|
|||
OFDictionary *_parameters;
|
||||
}
|
||||
|
||||
#ifdef OF_HAVE_PROPERTIES
|
||||
@property (copy) OFDictionary *parameters;
|
||||
#endif
|
||||
|
||||
- (void)setParameters: (OFDictionary*)parameters;
|
||||
- (OFDictionary*)parameters;
|
||||
- (void)connect;
|
||||
- (void)reset;
|
||||
- (void)close;
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#import "PGCommandFailedException.h"
|
||||
|
||||
@implementation PGConnection
|
||||
@synthesize parameters = _parameters;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_parameters release];
|
||||
|
@ -13,16 +15,6 @@
|
|||
[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];
|
||||
|
|
|
@ -5,13 +5,10 @@
|
|||
OFString *_command;
|
||||
}
|
||||
|
||||
#ifdef OF_HAVE_PROPERTIES
|
||||
@property (readonly, copy, nonatomic) OFString *command;
|
||||
#endif
|
||||
@property (readonly, copy) OFString *command;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command;
|
||||
- initWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command;
|
||||
- (OFString*)command;
|
||||
@end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#import "PGCommandFailedException.h"
|
||||
|
||||
@implementation PGCommandFailedException
|
||||
@synthesize command = _command;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
{
|
||||
|
@ -35,9 +37,4 @@
|
|||
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
|
||||
@"Command: %@", _error, _command];
|
||||
}
|
||||
|
||||
- (OFString*)command
|
||||
{
|
||||
OF_GETTER(_command, NO)
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -8,11 +8,8 @@
|
|||
OFString *_error;
|
||||
}
|
||||
|
||||
#ifdef OF_HAVE_PROPERTIES
|
||||
@property (readonly, retain, nonatomic) PGConnection *connection;
|
||||
#endif
|
||||
@property (readonly, retain) PGConnection *connection;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection;
|
||||
- initWithConnection: (PGConnection*)connection;
|
||||
- (PGConnection*)connection;
|
||||
@end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#import "PGException.h"
|
||||
|
||||
@implementation PGException
|
||||
@synthesize connection = _connection;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection] autorelease];
|
||||
|
@ -36,9 +38,4 @@
|
|||
return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@",
|
||||
_error];
|
||||
}
|
||||
|
||||
- (PGConnection*)connection
|
||||
{
|
||||
OF_GETTER(_connection, NO)
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue