Add -[PGConnection close].
FossilOrigin-Name: 52b090139e1672d79c01e1a7e3d681cd342101efbe04a6c1d4f395c6b65c797a
This commit is contained in:
parent
228f2ecdca
commit
16dc91b0e7
2 changed files with 10 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
- (OFDictionary*)parameters;
|
||||
- (void)connect;
|
||||
- (void)reset;
|
||||
- (void)close;
|
||||
- (PGResult*)executeCommand: (OFConstantString*)command;
|
||||
- (PGResult*)executeCommand: (OFConstantString*)command
|
||||
parameters: (id)firstParameter, ... OF_SENTINEL;
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
{
|
||||
[_parameters release];
|
||||
|
||||
if (_connnection != NULL)
|
||||
PQfinish(_connnection);
|
||||
[self close];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -58,6 +57,14 @@
|
|||
PQreset(_connnection);
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
if (_connnection != NULL)
|
||||
PQfinish(_connnection);
|
||||
|
||||
_connnection = NULL;
|
||||
}
|
||||
|
||||
- (PGResult*)executeCommand: (OFConstantString*)command
|
||||
{
|
||||
PGresult *result = PQexec(_connnection, [command UTF8String]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue