From 666ab2cfa7017982b3817645e599700506a2a398 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 7 Sep 2012 12:40:32 +0000 Subject: Don't expose the handler protocol or libpq types to the client and remember to initailise type extensions when a connection is established. --- Frameworks/PostgresKit/Source/FLXPostgresConnection.h | 3 +-- Frameworks/PostgresKit/Source/FLXPostgresConnection.m | 7 +++++++ 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:)]) { -- cgit v1.2.3