aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PostgresKit
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-09-07 12:40:32 +0000
committerstuconnolly <stuart02@gmail.com>2012-09-07 12:40:32 +0000
commit666ab2cfa7017982b3817645e599700506a2a398 (patch)
tree1efcdb1c8d1395b2b8dcc5b45afbf4a2587e9530 /Frameworks/PostgresKit
parent3a7d35c9036ab12e16d7696ece62cee548d594f0 (diff)
downloadsequelpro-666ab2cfa7017982b3817645e599700506a2a398.tar.gz
sequelpro-666ab2cfa7017982b3817645e599700506a2a398.tar.bz2
sequelpro-666ab2cfa7017982b3817645e599700506a2a398.zip
Don't expose the handler protocol or libpq types to the client and remember to initailise type extensions when a connection is established.
Diffstat (limited to 'Frameworks/PostgresKit')
-rw-r--r--Frameworks/PostgresKit/Source/FLXPostgresConnection.h3
-rw-r--r--Frameworks/PostgresKit/Source/FLXPostgresConnection.m7
2 files changed, 8 insertions, 2 deletions
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnection.h b/Frameworks/PostgresKit/Source/FLXPostgresConnection.h
index 6b96d624..5ff6f06b 100644
--- a/Frameworks/PostgresKit/Source/FLXPostgresConnection.h
+++ b/Frameworks/PostgresKit/Source/FLXPostgresConnection.h
@@ -20,7 +20,6 @@
// License for the specific language governing permissions and limitations under
// the License.
-#import "FLXPostgresTypeHandlerProtocol.h"
#import "FLXPostgresConnectionDelegate.h"
@class FLXPostgresError;
@@ -30,7 +29,7 @@
@interface FLXPostgresConnection : NSObject
{
- PGconn *_connection;
+ void *_connection;
NSString *_host;
NSString *_user;
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnection.m b/Frameworks/PostgresKit/Source/FLXPostgresConnection.m
index 2855e22d..6e7f2c84 100644
--- a/Frameworks/PostgresKit/Source/FLXPostgresConnection.m
+++ b/Frameworks/PostgresKit/Source/FLXPostgresConnection.m
@@ -24,6 +24,7 @@
#import "FLXPostgresConnectionParameters.h"
#import "FLXPostgresConnectionTypeHandling.h"
#import "FLXPostgresConnectionPrivateAPI.h"
+#import "FLXPostgresTypeHandlerProtocol.h"
#import "FLXPostgresTypeNumberHandler.h"
#import "FLXPostgresTypeStringHandler.h"
#import "FLXPostgresException.h"
@@ -330,8 +331,14 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message
// Increase error verbosity
PQsetErrorVerbosity(_connection, PQERRORS_VERBOSE);
+ // Set notice processor
PQsetNoticeProcessor(_connection, _FLXPostgresConnectionNoticeProcessor, self);
+ // Register type extensions
+ if (PQinitTypes(_connection)) {
+ _log(@"Failed initialise type extensions. Connection might return unexpected results!");
+ }
+
[self _loadDatabaseParameters];
if (_delegate && [_delegate respondsToSelector:@selector(connectionEstablished:)]) {