diff options
Diffstat (limited to 'Frameworks/PostgresKit/Source')
-rw-r--r-- | Frameworks/PostgresKit/Source/FLXConstants.h | 67 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/FLXConstants.m | 67 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/FLXPostgresTypes.h | 119 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGConstants.h | 67 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGConstants.m | 67 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnection.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnection.h) | 30 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnection.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnection.m) | 76 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionDelegate.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionDelegate.h) | 18 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.h) | 8 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.m) | 14 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.h) | 14 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.m) | 26 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.h) | 22 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m) | 94 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.h) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.m) | 26 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.h) | 14 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.m) | 36 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.h) | 8 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.m) | 18 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresError.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresError.h) | 6 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresError.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresError.m) | 14 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresException.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresException.h) | 6 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresException.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresException.m) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresKitPrivateAPI.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresKitPrivateAPI.h) | 16 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresResult.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresResult.h) | 24 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresResult.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresResult.m) | 40 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresStatement.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresStatement.h) | 6 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTimeInterval.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.h) | 8 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTimeInterval.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.m) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTimeTZ.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.h) | 10 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTimeTZ.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.m) | 14 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.h) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.m) | 82 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeHandler.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.h) | 16 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeHandler.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.m) | 10 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeHandlerProtocol.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeHandlerProtocol.h) | 16 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.h) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.m) | 62 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.h (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.h) | 12 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m) | 70 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGPostgresTypes.h | 119 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PGostgresStatement.m (renamed from Frameworks/PostgresKit/Source/FLXPostgresStatement.m) | 8 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PostgresKit-Prefix.pch | 4 | ||||
-rw-r--r-- | Frameworks/PostgresKit/Source/PostgresKit.h | 16 |
45 files changed, 705 insertions, 705 deletions
diff --git a/Frameworks/PostgresKit/Source/FLXConstants.h b/Frameworks/PostgresKit/Source/FLXConstants.h deleted file mode 100644 index 01e71919..00000000 --- a/Frameworks/PostgresKit/Source/FLXConstants.h +++ /dev/null @@ -1,67 +0,0 @@ -// -// $Id$ -// -// FLXConstants.h -// PostgresKit -// -// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com -// -// Forked by the Sequel Pro Team on July 22, 2012. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Connection defaults -extern const NSUInteger FLXPostgresConnectionDefaultTimeout; -extern const NSUInteger FLXPostgresConnectionDefaultServerPort; -extern const NSUInteger FLXPostgresConnectionDefaultKeepAlive; - -extern NSString *FLXPostgresConnectionDefaultEncoding; -extern NSString *FLXPostgresConnectionErrorDomain; -extern NSStringEncoding FLXPostgresConnectionDefaultStringEncoding; - -// Server parameters -extern NSString *FLXPostgresParameterServerEncoding; -extern NSString *FLXPostgresParameterClientEncoding; -extern NSString *FLXPostgresParameterSuperUser; -extern NSString *FLXPostgresParameterTimeZone; -extern NSString *FLXPostgresParameterIntegerDateTimes; - -// Result value specifiers -extern const char *FLXPostgresResultValueMacAddr; -extern const char *FLXPostgresResultValueInet; -extern const char *FLXPostgresResultValueCidr; -extern const char *FLXPostgresResultValueDate; -extern const char *FLXPostgresResultValueTime; -extern const char *FLXPostgresResultValueTimeTZ; -extern const char *FLXPostgresResultValueTimestamp; -extern const char *FLXPostgresResultValueTimestmpTZ; -extern const char *FLXPostgresResultValueInterval; -extern const char *FLXPostgresResultValueNumeric; -extern const char *FLXPostgresResultValueBool; -extern const char *FLXPostgresResultValueInt2; -extern const char *FLXPostgresResultValueInt4; -extern const char *FLXPostgresResultValueInt8; -extern const char *FLXPostgresResultValueFloat4; -extern const char *FLXPostgresResultValueFloat8; - -// Connection parameters -extern const char *FLXPostgresKitApplicationName; -extern const char *FLXPostgresApplicationParam; -extern const char *FLXPostgresUserParam; -extern const char *FLXPostgresHostParam; -extern const char *FLXPostgresPasswordParam; -extern const char *FLXPostgresPortParam; -extern const char *FLXPostgresDatabaseParam; -extern const char *FLXPostgresClientEncodingParam; -extern const char *FLXPostgresKeepAliveParam; -extern const char *FLXPostgresKeepAliveIntervalParam; diff --git a/Frameworks/PostgresKit/Source/FLXConstants.m b/Frameworks/PostgresKit/Source/FLXConstants.m deleted file mode 100644 index 16344a50..00000000 --- a/Frameworks/PostgresKit/Source/FLXConstants.m +++ /dev/null @@ -1,67 +0,0 @@ -// -// $Id$ -// -// FLXConstants.m -// PostgresKit -// -// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com -// -// Forked by the Sequel Pro Team on July 22, 2012. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -// Connection defaults -const NSUInteger FLXPostgresConnectionDefaultTimeout = 30; -const NSUInteger FLXPostgresConnectionDefaultServerPort = 5432; -const NSUInteger FLXPostgresConnectionDefaultKeepAlive = 60; - -NSString *FLXPostgresConnectionDefaultEncoding = @"UNICODE"; -NSString *FLXPostgresConnectionErrorDomain = @"FLXPostgresConnectionError"; -NSStringEncoding FLXPostgresConnectionDefaultStringEncoding = NSUTF8StringEncoding; - -// Server parameters -NSString *FLXPostgresParameterServerEncoding = @"server_encoding"; -NSString *FLXPostgresParameterClientEncoding = @"client_encoding"; -NSString *FLXPostgresParameterSuperUser = @"is_superuser"; -NSString *FLXPostgresParameterTimeZone = @"TimeZone"; -NSString *FLXPostgresParameterIntegerDateTimes = @"integer_datetimes"; - -// Result value specifiers -const char *FLXPostgresResultValueMacAddr = "%macaddr"; -const char *FLXPostgresResultValueInet = "%inet"; -const char *FLXPostgresResultValueCidr = "%cidr"; -const char *FLXPostgresResultValueDate = "%date"; -const char *FLXPostgresResultValueTime = "%time"; -const char *FLXPostgresResultValueTimeTZ = "%timetz"; -const char *FLXPostgresResultValueTimestamp = "%timestamp"; -const char *FLXPostgresResultValueTimestmpTZ = "%timestamptz"; -const char *FLXPostgresResultValueInterval = "%interval"; -const char *FLXPostgresResultValueNumeric = "%numeric"; -const char *FLXPostgresResultValueBool = "%bool"; -const char *FLXPostgresResultValueInt2 = "%int2"; -const char *FLXPostgresResultValueInt4 = "%int4"; -const char *FLXPostgresResultValueInt8 = "%int8"; -const char *FLXPostgresResultValueFloat4 = "%float4"; -const char *FLXPostgresResultValueFloat8 = "%float8"; - -// Connection parameters -const char *FLXPostgresKitApplicationName = "PostgresKit"; -const char *FLXPostgresApplicationParam = "application_name"; -const char *FLXPostgresUserParam = "user"; -const char *FLXPostgresHostParam = "host"; -const char *FLXPostgresPasswordParam = "password"; -const char *FLXPostgresPortParam = "port"; -const char *FLXPostgresDatabaseParam = "dbname"; -const char *FLXPostgresClientEncodingParam = "client_encoding"; -const char *FLXPostgresKeepAliveParam = "keepalives"; -const char *FLXPostgresKeepAliveIntervalParam = "keepalives_interval"; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypes.h b/Frameworks/PostgresKit/Source/FLXPostgresTypes.h deleted file mode 100644 index 9f923552..00000000 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypes.h +++ /dev/null @@ -1,119 +0,0 @@ -// -// $Id$ -// -// FLXPostgresTypes.h -// PostgresKit -// -// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com -// -// Forked by the Sequel Pro Team on July 22, 2012. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you may not -// use this file except in compliance with the License. You may obtain a copy of -// the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -// License for the specific language governing permissions and limitations under -// the License. - -#import "postgres_ext.h" - -// Generic PostgreSQL object ID -typedef Oid FLXPostgresOid; - -// See PostgreSQL source: include/catalog/pg_type.h - -enum -{ - // BOOL - FLXPostgresOidBool = 16, // NumberHandler => NSNumber - FLXPostgresOidByteData = 17, // Currently not supported - - // Text - FLXPostgresOidName = 19, // StringHandler => NSString - - // Integers - FLXPostgresOidInt8 = 20, // NumberHandler => NSNumber - FLXPostgresOidInt2 = 21, // NumberHandler => NSNumber - FLXPostgresOidInt4 = 23, // NumberHandler => NSNumber - - // Text - FLXPostgresOidText = 25, // StringHandler => NSString - - // OID - FLXPostgresOidOid = 26, // NumberHandler => NSNumber - - // XML - FLXPostgresOidXML = 142, // StringHandler => NSString - - // Geometric - FLXPostgresOidPoint = 600, // Currently not supported - FLXPostgresOidLSeg = 601, // Currently not supported - FLXPostgresOidPath = 602, // Currently not supported - FLXPostgresOidBox = 603, // Currently not supported - FLXPostgresOidPolygon = 604, // Currently not supported - - // Network - FLXPostgresOidCidrAddr = 650, // StringHandler => NSString - - // Float - FLXPostgresOidFloat4 = 700, // NumberHandler => NSNumber - FLXPostgresOidFloat8 = 701, // NumberHandler => NSNumber - - // ABS Time - FLXPostgresOidAbsTime = 702, // DateHandler => NSDate - - // What! - FLXPostgresOidUnknown = 705, // StringHandler => NSString - - // Geometric - FLXPostgresOidCircle = 718, // Currently not supported - - // Monetary - FLXPostgresOidMoney = 790, // NumberHandler => NSNumber - - // Network - FLXPostgresOidMacAddr = 829, // StringHandler => NSString - FLXPostgresOidInetAddr = 869, // StringHandler => NSString - - // Arrays - FLXPostgresOidArrayBool = 1000, // Currently not supported - FLXPostgresOidArrayData = 1001, // Currently not supported - FLXPostgresOidArrayChar = 1002, // Currently not supported - FLXPostgresOidArrayName = 1003, // Currently not supported - FLXPostgresOidArrayInt2 = 1005, // Currently not supported - FLXPostgresOidArrayInt4 = 1007, // Currently not supported - FLXPostgresOidArrayText = 1009, // Currently not supported - FLXPostgresOidArrayVarchar = 1015, // Currently not supported - FLXPostgresOidArrayInt8 = 1016, // Currently not supported - FLXPostgresOidArrayFloat4 = 1021, // Currently not supported - FLXPostgresOidArrayFloat8 = 1022, // Currently not supported - FLXPostgresOidArrayMacAddr = 1040, // Currently not supported - FLXPostgresOidArrayIPAddr = 1041, // Currently not supported - - // Text - FLXPostgresOidChar = 1042, // StringHandler => NSString - FLXPostgresOidVarChar = 1043, // StringHandler => NSString - - // Date/time - FLXPostgresOidDate = 1082, // DateHandler => NSDate - FLXPostgresOidTime = 1083, // DateHandler => NSDate - FLXPostgresOidTimestamp = 1114, // DateHandler => NSDate - FLXPostgresOidTimestampTZ = 1184, // DateHandler => FLXPostgresTimeTZ - FLXPostgresOidInterval = 1186, // DateHandler => FLXPostgresTimeInterval - FLXPostgresOidTimeTZ = 1266, // DateHandler => FLXPostgresTimeTZ - - // Bit strings - FLXPostgresOidBit = 1560, // StringHandler => NSString - FLXPostgresOidVarBit = 1562, // StringHandler => NSString - - // Numeric - FLXPostgresOidNumeric = 1700, // NumberHandler => NSNumber - - // UUID - FLXPostgresOidUUID = 2950 // StringHandler => NSString -}; diff --git a/Frameworks/PostgresKit/Source/PGConstants.h b/Frameworks/PostgresKit/Source/PGConstants.h new file mode 100644 index 00000000..d8ac3641 --- /dev/null +++ b/Frameworks/PostgresKit/Source/PGConstants.h @@ -0,0 +1,67 @@ +// +// $Id: PGConstants.h 3866 2012-09-26 01:30:28Z stuart02 $ +// +// PGConstants.h +// PostgresKit +// +// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com +// +// Forked by the Sequel Pro Team on July 22, 2012. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +// Connection defaults +extern const NSUInteger PGPostgresConnectionDefaultTimeout; +extern const NSUInteger PGPostgresConnectionDefaultServerPort; +extern const NSUInteger PGPostgresConnectionDefaultKeepAlive; + +extern NSString *PGPostgresConnectionDefaultEncoding; +extern NSString *PGPostgresConnectionErrorDomain; +extern NSStringEncoding PGPostgresConnectionDefaultStringEncoding; + +// Server parameters +extern NSString *PGPostgresParameterServerEncoding; +extern NSString *PGPostgresParameterClientEncoding; +extern NSString *PGPostgresParameterSuperUser; +extern NSString *PGPostgresParameterTimeZone; +extern NSString *PGPostgresParameterIntegerDateTimes; + +// Result value specifiers +extern const char *PGPostgresResultValueMacAddr; +extern const char *PGPostgresResultValueInet; +extern const char *PGPostgresResultValueCidr; +extern const char *PGPostgresResultValueDate; +extern const char *PGPostgresResultValueTime; +extern const char *PGPostgresResultValueTimeTZ; +extern const char *PGPostgresResultValueTimestamp; +extern const char *PGPostgresResultValueTimestmpTZ; +extern const char *PGPostgresResultValueInterval; +extern const char *PGPostgresResultValueNumeric; +extern const char *PGPostgresResultValueBool; +extern const char *PGPostgresResultValueInt2; +extern const char *PGPostgresResultValueInt4; +extern const char *PGPostgresResultValueInt8; +extern const char *PGPostgresResultValueFloat4; +extern const char *PGPostgresResultValueFloat8; + +// Connection parameters +extern const char *PGPostgresKitApplicationName; +extern const char *PGPostgresApplicationParam; +extern const char *PGPostgresUserParam; +extern const char *PGPostgresHostParam; +extern const char *PGPostgresPasswordParam; +extern const char *PGPostgresPortParam; +extern const char *PGPostgresDatabaseParam; +extern const char *PGPostgresClientEncodingParam; +extern const char *PGPostgresKeepAliveParam; +extern const char *PGPostgresKeepAliveIntervalParam; diff --git a/Frameworks/PostgresKit/Source/PGConstants.m b/Frameworks/PostgresKit/Source/PGConstants.m new file mode 100644 index 00000000..169dd85c --- /dev/null +++ b/Frameworks/PostgresKit/Source/PGConstants.m @@ -0,0 +1,67 @@ +// +// $Id: PGConstants.m 3866 2012-09-26 01:30:28Z stuart02 $ +// +// PGConstants.m +// PostgresKit +// +// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com +// +// Forked by the Sequel Pro Team on July 22, 2012. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +// Connection defaults +const NSUInteger PGPostgresConnectionDefaultTimeout = 30; +const NSUInteger PGPostgresConnectionDefaultServerPort = 5432; +const NSUInteger PGPostgresConnectionDefaultKeepAlive = 60; + +NSString *PGPostgresConnectionDefaultEncoding = @"UNICODE"; +NSString *PGPostgresConnectionErrorDomain = @"PGPostgresConnectionError"; +NSStringEncoding PGPostgresConnectionDefaultStringEncoding = NSUTF8StringEncoding; + +// Server parameters +NSString *PGPostgresParameterServerEncoding = @"server_encoding"; +NSString *PGPostgresParameterClientEncoding = @"client_encoding"; +NSString *PGPostgresParameterSuperUser = @"is_superuser"; +NSString *PGPostgresParameterTimeZone = @"TimeZone"; +NSString *PGPostgresParameterIntegerDateTimes = @"integer_datetimes"; + +// Result value specifiers +const char *PGPostgresResultValueMacAddr = "%macaddr"; +const char *PGPostgresResultValueInet = "%inet"; +const char *PGPostgresResultValueCidr = "%cidr"; +const char *PGPostgresResultValueDate = "%date"; +const char *PGPostgresResultValueTime = "%time"; +const char *PGPostgresResultValueTimeTZ = "%timetz"; +const char *PGPostgresResultValueTimestamp = "%timestamp"; +const char *PGPostgresResultValueTimestmpTZ = "%timestamptz"; +const char *PGPostgresResultValueInterval = "%interval"; +const char *PGPostgresResultValueNumeric = "%numeric"; +const char *PGPostgresResultValueBool = "%bool"; +const char *PGPostgresResultValueInt2 = "%int2"; +const char *PGPostgresResultValueInt4 = "%int4"; +const char *PGPostgresResultValueInt8 = "%int8"; +const char *PGPostgresResultValueFloat4 = "%float4"; +const char *PGPostgresResultValueFloat8 = "%float8"; + +// Connection parameters +const char *PGPostgresKitApplicationName = "PostgresKit"; +const char *PGPostgresApplicationParam = "application_name"; +const char *PGPostgresUserParam = "user"; +const char *PGPostgresHostParam = "host"; +const char *PGPostgresPasswordParam = "password"; +const char *PGPostgresPortParam = "port"; +const char *PGPostgresDatabaseParam = "dbname"; +const char *PGPostgresClientEncodingParam = "client_encoding"; +const char *PGPostgresKeepAliveParam = "keepalives"; +const char *PGPostgresKeepAliveIntervalParam = "keepalives_interval"; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnection.h b/Frameworks/PostgresKit/Source/PGPostgresConnection.h index 87ac46d3..bf1f51d0 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnection.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnection.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnection.h 3845 2012-09-11 09:35:40Z stuart02 $ // -// FLXPostgresConnection.h +// PGPostgresConnection.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,14 +20,14 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnectionDelegate.h" +#import "PGPostgresConnectionDelegate.h" -@class FLXPostgresError; -@class FLXPostgresResult; -@class FLXPostgresStatement; -@class FLXPostgresConnectionParameters; +@class PGPostgresError; +@class PGPostgresResult; +@class PGPostgresStatement; +@class PGPostgresConnectionParameters; -@interface FLXPostgresConnection : NSObject +@interface PGPostgresConnection : NSObject { void *_connection; @@ -56,13 +56,13 @@ NSMutableDictionary *_typeMap; - FLXPostgresError *_lastError; - FLXPostgresConnectionParameters *_parameters; + PGPostgresError *_lastError; + PGPostgresConnectionParameters *_parameters; - NSObject <FLXPostgresConnectionDelegate> *_delegate; + NSObject <PGPostgresConnectionDelegate> *_delegate; } -@property (readwrite, assign) NSObject <FLXPostgresConnectionDelegate> *delegate; +@property (readwrite, assign) NSObject <PGPostgresConnectionDelegate> *delegate; @property (readwrite, retain) NSString *host; @property (readwrite, retain) NSString *user; @@ -73,9 +73,9 @@ @property (readonly) NSString *encoding; @property (readonly) NSString *connectionError; -@property (readonly) FLXPostgresError *lastError; +@property (readonly) PGPostgresError *lastError; @property (readonly) NSStringEncoding stringEncoding; -@property (readonly) FLXPostgresConnectionParameters *parameters; +@property (readonly) PGPostgresConnectionParameters *parameters; @property (readwrite, assign) BOOL useSocket; @property (readwrite, assign) BOOL useKeepAlive; @@ -85,7 +85,7 @@ @property (readwrite, assign) NSUInteger port; @property (readwrite, assign) NSUInteger keepAliveInterval; -- (id)initWithDelegate:(NSObject <FLXPostgresConnectionDelegate> *)delegate; +- (id)initWithDelegate:(NSObject <PGPostgresConnectionDelegate> *)delegate; - (BOOL)connect; - (void)disconnect; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnection.m b/Frameworks/PostgresKit/Source/PGPostgresConnection.m index a649a982..8fcf8ae0 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnection.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnection.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnection.m 3848 2012-09-12 12:19:31Z stuart02 $ // -// FLXPostgresConnection.m +// PGPostgresConnection.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,32 +20,32 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" -#import "FLXPostgresConnectionParameters.h" -#import "FLXPostgresConnectionTypeHandling.h" -#import "FLXPostgresKitPrivateAPI.h" -#import "FLXPostgresTypeHandlerProtocol.h" -#import "FLXPostgresTypeNumberHandler.h" -#import "FLXPostgresTypeStringHandler.h" -#import "FLXPostgresException.h" -#import "FLXPostgresStatement.h" -#import "FLXPostgresResult.h" +#import "PGPostgresConnection.h" +#import "PGPostgresConnectionParameters.h" +#import "PGPostgresConnectionTypeHandling.h" +#import "PGPostgresKitPrivateAPI.h" +#import "PGPostgresTypeHandlerProtocol.h" +#import "PGPostgresTypeNumberHandler.h" +#import "PGPostgresTypeStringHandler.h" +#import "PGPostgresException.h" +#import "PGPostgresStatement.h" +#import "PGPostgresResult.h" #import <pthread.h> #import <poll.h> -@interface FLXPostgresConnection () +@interface PGPostgresConnection () - (void)_loadDatabaseParameters; - (void)_createConnectionParameters; - (void)_pollConnection:(NSNumber *)isReset; // libpq callback -static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message); +static void _PGPostgresConnectionNoticeProcessor(void *arg, const char *message); @end -@implementation FLXPostgresConnection +@implementation PGPostgresConnection @synthesize port = _port; @synthesize host = _host; @@ -81,25 +81,25 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message * * @return The new connection instance. */ -- (id)initWithDelegate:(NSObject <FLXPostgresConnectionDelegate> *)delegate +- (id)initWithDelegate:(NSObject <PGPostgresConnectionDelegate> *)delegate { if ((self = [super init])) { _delegate = delegate; - _port = FLXPostgresConnectionDefaultServerPort; - _timeout = FLXPostgresConnectionDefaultTimeout; + _port = PGPostgresConnectionDefaultServerPort; + _timeout = PGPostgresConnectionDefaultTimeout; _useKeepAlive = YES; - _keepAliveInterval = FLXPostgresConnectionDefaultKeepAlive; + _keepAliveInterval = PGPostgresConnectionDefaultKeepAlive; _lastError = nil; _connection = nil; _connectionError = nil; _lastQueryWasCancelled = NO; - _stringEncoding = FLXPostgresConnectionDefaultStringEncoding; - _encoding = [NSString stringWithString:FLXPostgresConnectionDefaultEncoding]; + _stringEncoding = PGPostgresConnectionDefaultStringEncoding; + _encoding = [NSString stringWithString:PGPostgresConnectionDefaultEncoding]; _delegateSupportsWillExecute = [_delegate respondsToSelector:@selector(connection:willExecute:withValues:)]; @@ -164,7 +164,7 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message - (BOOL)connect { if ([self isConnected]) { - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain reason:@"Attempt to initiate a connection that is already active"]; + [PGPostgresException raise:PGPostgresConnectionErrorDomain reason:@"Attempt to initiate a connection that is already active"]; return NO; } @@ -270,7 +270,7 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message if (!result) { if (error != NULL) { - *error = [NSError errorWithDomain:FLXPostgresConnectionErrorDomain + *error = [NSError errorWithDomain:PGPostgresConnectionErrorDomain code:0 userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithUTF8String:errorBuf] forKey:NSLocalizedDescriptionKey]]; } @@ -327,7 +327,7 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message PQsetErrorVerbosity(_connection, PQERRORS_VERBOSE); // Set notice processor - PQsetNoticeProcessor(_connection, _FLXPostgresConnectionNoticeProcessor, self); + PQsetNoticeProcessor(_connection, _PGPostgresConnectionNoticeProcessor, self); NSInteger success = reset ? PQclearTypes(_connection) : PQinitTypes(_connection); @@ -360,7 +360,7 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message { if (_parameters) [_parameters release]; - _parameters = [[FLXPostgresConnectionParameters alloc] initWithConnection:self]; + _parameters = [[PGPostgresConnectionParameters alloc] initWithConnection:self]; BOOL success = [_parameters loadParameters]; @@ -373,11 +373,11 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message * @param arg The calling connection. * @param message The message that was sent. */ -static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message) +static void _PGPostgresConnectionNoticeProcessor(void *arg, const char *message) { - FLXPostgresConnection *connection = (FLXPostgresConnection *)arg; + PGPostgresConnection *connection = (PGPostgresConnection *)arg; - if ([connection isKindOfClass:[FLXPostgresConnection class]]) { + if ([connection isKindOfClass:[PGPostgresConnection class]]) { if ([connection delegate] && [[connection delegate] respondsToSelector:@selector(connection:notice:)]) { [[connection delegate] connection:connection notice:[NSString stringWithUTF8String:message]]; @@ -408,46 +408,46 @@ static void _FLXPostgresConnectionNoticeProcessor(void *arg, const char *message _connectionParamNames = malloc(paramCount * sizeof(*_connectionParamNames)); _connectionParamValues = malloc(paramCount * sizeof(*_connectionParamValues)); - _connectionParamNames[0] = FLXPostgresApplicationParam; - _connectionParamValues[0] = !_applicationName ? [_applicationName UTF8String] : FLXPostgresKitApplicationName; + _connectionParamNames[0] = PGPostgresApplicationParam; + _connectionParamValues[0] = !_applicationName ? [_applicationName UTF8String] : PGPostgresKitApplicationName; - _connectionParamNames[1] = FLXPostgresPortParam; + _connectionParamNames[1] = PGPostgresPortParam; _connectionParamValues[1] = [[[NSNumber numberWithUnsignedInteger:_port] stringValue] UTF8String]; - _connectionParamNames[2] = FLXPostgresClientEncodingParam; + _connectionParamNames[2] = PGPostgresClientEncodingParam; _connectionParamValues[2] = [_encoding UTF8String]; - _connectionParamNames[3] = FLXPostgresKeepAliveParam; + _connectionParamNames[3] = PGPostgresKeepAliveParam; _connectionParamValues[3] = _useKeepAlive ? "1" : "0"; - _connectionParamNames[4] = FLXPostgresKeepAliveIntervalParam; + _connectionParamNames[4] = PGPostgresKeepAliveIntervalParam; _connectionParamValues[4] = [[[NSNumber numberWithUnsignedInteger:_keepAliveInterval] stringValue] UTF8String]; NSUInteger i = 5; if (hasUser) { - _connectionParamNames[i] = FLXPostgresUserParam; + _connectionParamNames[i] = PGPostgresUserParam; _connectionParamValues[i] = [_user UTF8String]; i++; } if (hasHost) { - _connectionParamNames[i] = FLXPostgresHostParam; + _connectionParamNames[i] = PGPostgresHostParam; _connectionParamValues[i] = [_host UTF8String]; i++; } if (hasPassword) { - _connectionParamNames[i] = FLXPostgresPasswordParam; + _connectionParamNames[i] = PGPostgresPasswordParam; _connectionParamValues[i] = [_password UTF8String]; i++; } if (hasDatabase) { - _connectionParamNames[i] = FLXPostgresDatabaseParam; + _connectionParamNames[i] = PGPostgresDatabaseParam; _connectionParamValues[i] = [_database UTF8String]; i++; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionDelegate.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionDelegate.h index d8fd3ac6..05390aa3 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionDelegate.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionDelegate.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionDelegate.h 3841 2012-09-10 08:52:00Z stuart02 $ // -// FLXPostgresConnectionDelegate.h +// PGPostgresConnectionDelegate.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,30 +20,30 @@ // License for the specific language governing permissions and limitations under // the License. -@class FLXPostgresConnection; +@class PGPostgresConnection; -@protocol FLXPostgresConnectionDelegate <NSObject> +@protocol PGPostgresConnectionDelegate <NSObject> /** * Called whenever the supplied connection has been successfully established and is ready to use. * * @param connection The connection instance. */ -- (void)connectionEstablished:(FLXPostgresConnection *)connection; +- (void)connectionEstablished:(PGPostgresConnection *)connection; /** * Called whenever the supplied connection has been successfully reset and is ready to use. * * @param connection The connection instance. */ -- (void)connectionReset:(FLXPostgresConnection *)connection; +- (void)connectionReset:(PGPostgresConnection *)connection; /** * Called whenever a connection is disconnected. * * @param connection The connection instance. */ -- (void)connectionDisconnected:(FLXPostgresConnection *)connection; +- (void)connectionDisconnected:(PGPostgresConnection *)connection; /** * Called whenever a message is received from the PostgreSQL server. @@ -51,7 +51,7 @@ * @param connection The connection instance. * @param notice The notice message received. */ -- (void)connection:(FLXPostgresConnection *)connection notice:(NSString *)notice; +- (void)connection:(PGPostgresConnection *)connection notice:(NSString *)notice; /** * Called just before a query is about to be executed. @@ -60,6 +60,6 @@ * @param query The query about the be executed. * @param values The values of the query. */ -- (void)connection:(FLXPostgresConnection *)connection willExecute:(NSObject *)query withValues:(NSArray *)values; +- (void)connection:(PGPostgresConnection *)connection willExecute:(NSObject *)query withValues:(NSArray *)values; @end diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.h index c6686465..fee143a8 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.h @@ -1,6 +1,6 @@ -// $Id$ +// $Id: PGPostgresConnectionEncoding.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresConnectionEncoding.h +// PGPostgresConnectionEncoding.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on August 4, 2012. @@ -27,9 +27,9 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresConnection.h" +#import "PGPostgresConnection.h" -@interface FLXPostgresConnection (FLXPostgresConnectionEncoding) +@interface PGPostgresConnection (PGPostgresConnectionEncoding) - (BOOL)setEncoding:(NSString *)encoding; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.m index a58de60b..b8422f78 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionEncoding.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionEncoding.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionEncoding.m 3825 2012-09-09 00:43:58Z stuart02 $ // -// FLXPostgresConnectionEncoding.m +// PGPostgresConnectionEncoding.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on August 4, 2012. @@ -28,10 +28,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresConnectionEncoding.h" -#import "FLXPostgresKitPrivateAPI.h" +#import "PGPostgresConnectionEncoding.h" +#import "PGPostgresKitPrivateAPI.h" -@implementation FLXPostgresConnection (FLXPostgresConnectionEncoding) +@implementation PGPostgresConnection (PGPostgresConnectionEncoding) /** * Set the current connection's encoding. @@ -51,7 +51,7 @@ [_encoding release], _encoding = [[NSString alloc] initWithString:encoding]; - _stringEncoding = [FLXPostgresConnection stringEncodingForPostgreSQLCharset:[encoding UTF8String]]; + _stringEncoding = [PGPostgresConnection stringEncodingForPostgreSQLCharset:[encoding UTF8String]]; return YES; } @@ -149,7 +149,7 @@ NSLog(@"PostgresKit: Warning: Unable to process unknown PostgreSQL encoding '%s'; falling back to UTF8.", charset); - return FLXPostgresConnectionDefaultStringEncoding; + return PGPostgresConnectionDefaultStringEncoding; } /** diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.h index 84864a1a..f81140aa 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionParameters.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresConnectionParameters.h +// PGPostgresConnectionParameters.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on August 29, 2012. @@ -30,11 +30,11 @@ #import <pthread.h> -@class FLXPostgresConnection; +@class PGPostgresConnection; -@interface FLXPostgresConnectionParameters : NSObject +@interface PGPostgresConnectionParameters : NSObject { - FLXPostgresConnection *_connection; + PGPostgresConnection *_connection; NSMutableArray *_parameterNames; NSMutableDictionary *_parameters; @@ -45,9 +45,9 @@ /** * @property connection The database connection to use. */ -@property (readwrite, assign) FLXPostgresConnection *connection; +@property (readwrite, assign) PGPostgresConnection *connection; -- (id)initWithConnection:(FLXPostgresConnection *)connection; +- (id)initWithConnection:(PGPostgresConnection *)connection; - (BOOL)loadParameters; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.m index b5c3d9db..e179f110 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionParameters.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionParameters.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionParameters.m 3848 2012-09-12 12:19:31Z stuart02 $ // -// FLXPostgresConnectionParameters.m +// PGPostgresConnectionParameters.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on August 29, 2012. @@ -28,11 +28,11 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresConnectionParameters.h" -#import "FLXPostgresKitPrivateAPI.h" -#import "FLXPostgresConnection.h" +#import "PGPostgresConnectionParameters.h" +#import "PGPostgresKitPrivateAPI.h" +#import "PGPostgresConnection.h" -@interface FLXPostgresConnectionParameters () +@interface PGPostgresConnectionParameters () - (void)_loadParameters:(id)object; - (BOOL)_isBooleanParameterValue:(NSString *)value; @@ -40,7 +40,7 @@ @end -@implementation FLXPostgresConnectionParameters +@implementation PGPostgresConnectionParameters @synthesize connection = _connection; @@ -58,7 +58,7 @@ * * @return The initialised instance. */ -- (id)initWithConnection:(FLXPostgresConnection *)connection +- (id)initWithConnection:(PGPostgresConnection *)connection { if ((self = [super init])) { _connection = connection; @@ -90,11 +90,11 @@ if (!_parameterNames) { _parameterNames = [[NSMutableArray alloc] init]; - [_parameterNames addObject:FLXPostgresParameterServerEncoding]; - [_parameterNames addObject:FLXPostgresParameterClientEncoding]; - [_parameterNames addObject:FLXPostgresParameterSuperUser]; - [_parameterNames addObject:FLXPostgresParameterTimeZone]; - [_parameterNames addObject:FLXPostgresParameterIntegerDateTimes]; + [_parameterNames addObject:PGPostgresParameterServerEncoding]; + [_parameterNames addObject:PGPostgresParameterClientEncoding]; + [_parameterNames addObject:PGPostgresParameterSuperUser]; + [_parameterNames addObject:PGPostgresParameterTimeZone]; + [_parameterNames addObject:PGPostgresParameterIntegerDateTimes]; } pthread_mutex_unlock(&_readLock); diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.h index b1c8aed0..2fbfb74d 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionQueryExecution.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresConnectionQueryExecution.h +// PGPostgresConnectionQueryExecution.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,18 +20,18 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" +#import "PGPostgresConnection.h" -@interface FLXPostgresConnection (FLXPostgresConnectionQueryExecution) +@interface PGPostgresConnection (PGPostgresConnectionQueryExecution) // Synchronous interface -- (FLXPostgresResult *)execute:(NSString *)query; -- (FLXPostgresResult *)executeWithFormat:(NSString *)query, ...; -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement; -- (FLXPostgresResult *)execute:(NSString *)query values:(NSArray *)values; -- (FLXPostgresResult *)execute:(NSString *)query value:(NSObject *)value; -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement values:(NSArray *)values; -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement value:(NSObject *)value; +- (PGPostgresResult *)execute:(NSString *)query; +- (PGPostgresResult *)executeWithFormat:(NSString *)query, ...; +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement; +- (PGPostgresResult *)execute:(NSString *)query values:(NSArray *)values; +- (PGPostgresResult *)execute:(NSString *)query value:(NSObject *)value; +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement values:(NSArray *)values; +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement value:(NSObject *)value; // Asynchronous interface diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m index a41471a3..4dec74a6 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryExecution.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionQueryExecution.m 3841 2012-09-10 08:52:00Z stuart02 $ // -// FLXPostgresConnectionQueryExecution.h +// PGPostgresConnectionQueryExecution.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,76 +20,76 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnectionQueryExecution.h" -#import "FLXPostgresKitPrivateAPI.h" -#import "FLXPostgresConnectionTypeHandling.h" -#import "FLXPostgresConnectionDelegate.h" -#import "FLXPostgresTypeHandlerProtocol.h" -#import "FLXPostgresConnection.h" -#import "FLXPostgresException.h" -#import "FLXPostgresResult.h" -#import "FLXPostgresStatement.h" -#import "FLXPostgresError.h" +#import "PGPostgresConnectionQueryExecution.h" +#import "PGPostgresKitPrivateAPI.h" +#import "PGPostgresConnectionTypeHandling.h" +#import "PGPostgresConnectionDelegate.h" +#import "PGPostgresTypeHandlerProtocol.h" +#import "PGPostgresConnection.h" +#import "PGPostgresException.h" +#import "PGPostgresResult.h" +#import "PGPostgresStatement.h" +#import "PGPostgresError.h" // Constants -static int FLXPostgresResultsAsBinary = 1; +static int PGPostgresResultsAsBinary = 1; // Internal query structure typedef struct { int paramNum; const void **paramValues; - FLXPostgresOid* paramTypes; + PGPostgresOid* paramTypes; int *paramLengths; int *paramFormats; } -FLXQueryParamData; +PGQueryParamData; -@interface FLXPostgresConnection () +@interface PGPostgresConnection () -- (FLXPostgresResult *)_execute:(NSObject *)query values:(NSArray *)values; +- (PGPostgresResult *)_execute:(NSObject *)query values:(NSArray *)values; - (BOOL)_queryDidError:(PGresult *)result; -- (FLXQueryParamData *)_createParameterDataStructureWithCount:(int)paramNum; -- (void)_destroyParamDataStructure:(FLXQueryParamData *)paramData; +- (PGQueryParamData *)_createParameterDataStructureWithCount:(int)paramNum; +- (void)_destroyParamDataStructure:(PGQueryParamData *)paramData; @end -@implementation FLXPostgresConnection (FLXPostgresConnectionQueryExecution) +@implementation PGPostgresConnection (PGPostgresConnectionQueryExecution) #pragma mark - #pragma mark Synchronous Interface -- (FLXPostgresResult *)execute:(NSString *)query +- (PGPostgresResult *)execute:(NSString *)query { return [self _execute:query values:nil]; } -- (FLXPostgresResult *)execute:(NSString *)query value:(NSObject *)value +- (PGPostgresResult *)execute:(NSString *)query value:(NSObject *)value { return [self _execute:query values:[NSArray arrayWithObject:value]]; } -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement value:(NSObject *)value +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement value:(NSObject *)value { return [self _execute:statement values:[NSArray arrayWithObject:value]]; } -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement { return [self _execute:statement values:nil]; } -- (FLXPostgresResult *)executePrepared:(FLXPostgresStatement *)statement values:(NSArray *)values +- (PGPostgresResult *)executePrepared:(PGPostgresStatement *)statement values:(NSArray *)values { return [self _execute:statement values:values]; } -- (FLXPostgresResult *)execute:(NSString *)query values:(NSArray *)values +- (PGPostgresResult *)execute:(NSString *)query values:(NSArray *)values { return [self _execute:query values:values]; } -- (FLXPostgresResult *)executeWithFormat:(NSString *)query, ... +- (PGPostgresResult *)executeWithFormat:(NSString *)query, ... { va_list argumentList; va_start(argumentList, query); @@ -100,7 +100,7 @@ FLXQueryParamData; va_end(argumentList); - FLXPostgresResult *result = [self _execute:string values:nil]; + PGPostgresResult *result = [self _execute:string values:nil]; [string release]; @@ -113,18 +113,18 @@ FLXQueryParamData; #pragma mark - #pragma mark Private API -- (FLXPostgresResult *)_execute:(NSObject *)query values:(NSArray *)values +- (PGPostgresResult *)_execute:(NSObject *)query values:(NSArray *)values { _lastQueryWasCancelled = NO; - if (![self isConnected] || !query || ![query isKindOfClass:[NSString class]] || [query isKindOfClass:[FLXPostgresStatement class]]) return nil; + if (![self isConnected] || !query || ![query isKindOfClass:[NSString class]] || [query isKindOfClass:[PGPostgresStatement class]]) return nil; // Notify the delegate if (_delegate && _delegateSupportsWillExecute) { [_delegate connection:self willExecute:query withValues:values]; } - FLXQueryParamData *paramData = [self _createParameterDataStructureWithCount:values ? (int)[values count] : 0]; + PGQueryParamData *paramData = [self _createParameterDataStructureWithCount:values ? (int)[values count] : 0]; if (!paramData) return nil; @@ -144,24 +144,24 @@ FLXQueryParamData; } // Obtain correct handler for this class - id <FLXPostgresTypeHandlerProtocol> typeHandler = [self typeHandlerForClass:[nativeObject class]]; + id <PGPostgresTypeHandlerProtocol> typeHandler = [self typeHandlerForClass:[nativeObject class]]; if (!typeHandler) { [self _destroyParamDataStructure:paramData]; // TODO: get rid of exceptions - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Parameter $%u unsupported class %@", (i + 1), NSStringFromClass([nativeObject class])]]; + [PGPostgresException raise:PGPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Parameter $%u unsupported class %@", (i + 1), NSStringFromClass([nativeObject class])]]; return nil; } NSData *data = nil; // Sending parameters as binary is not implemented yet - FLXPostgresOid type = 0; + PGPostgresOid type = 0; if (!data) { [self _destroyParamDataStructure:paramData]; // TODO: get rid of exceptions - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Parameter $%u cannot be converted into a bound value", (i + 1)]]; + [PGPostgresException raise:PGPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Parameter $%u cannot be converted into a bound value", (i + 1)]]; return nil; } @@ -170,7 +170,7 @@ FLXQueryParamData; [self _destroyParamDataStructure:paramData]; // TODO: get rid of exceptions - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Bound value $%u exceeds maximum size", (i + 1)]]; + [PGPostgresException raise:PGPostgresConnectionErrorDomain reason:[NSString stringWithFormat:@"Bound value $%u exceeds maximum size", (i + 1)]]; return nil; } @@ -204,10 +204,10 @@ FLXQueryParamData; (const char **)paramData->paramValues, (const int *)paramData->paramLengths, (const int *)paramData->paramFormats, - FLXPostgresResultsAsBinary); + PGPostgresResultsAsBinary); } - else if ([query isKindOfClass:[FLXPostgresStatement class]]) { - FLXPostgresStatement *statement = (FLXPostgresStatement *)query; + else if ([query isKindOfClass:[PGPostgresStatement class]]) { + PGPostgresStatement *statement = (PGPostgresStatement *)query; // Statement has not been prepared yet, so prepare it with the given parameter types if (![statement name]) { @@ -222,14 +222,14 @@ FLXQueryParamData; (const char **)paramData->paramValues, (const int *)paramData->paramLengths, (const int *)paramData->paramFormats, - FLXPostgresResultsAsBinary); + PGPostgresResultsAsBinary); } [self _destroyParamDataStructure:paramData]; if (!result || [self _queryDidError:result]) return nil; - return [[[FLXPostgresResult alloc] initWithResult:result connection:self] autorelease]; + return [[[PGPostgresResult alloc] initWithResult:result connection:self] autorelease]; } /** @@ -246,7 +246,7 @@ FLXQueryParamData; if (status == PGRES_BAD_RESPONSE || status == PGRES_FATAL_ERROR) { if (_lastError) [_lastError release], _lastError = nil; - _lastError = [[FLXPostgresError alloc] initWithResult:result]; + _lastError = [[PGPostgresError alloc] initWithResult:result]; PQclear(result); @@ -265,9 +265,9 @@ FLXQueryParamData; * * @return The data structure or nil if an exception occurred. */ -- (FLXQueryParamData *)_createParameterDataStructureWithCount:(int)paramNum +- (PGQueryParamData *)_createParameterDataStructureWithCount:(int)paramNum { - FLXQueryParamData *paramData = malloc(sizeof(FLXQueryParamData)); + PGQueryParamData *paramData = malloc(sizeof(PGQueryParamData)); paramData->paramNum = paramNum; paramData->paramValues = NULL; @@ -277,7 +277,7 @@ FLXQueryParamData; if (paramData->paramNum) { paramData->paramValues = malloc(sizeof(void *) * paramData->paramNum); - paramData->paramTypes = malloc(sizeof(FLXPostgresOid) * paramData->paramNum); + paramData->paramTypes = malloc(sizeof(PGPostgresOid) * paramData->paramNum); paramData->paramLengths = malloc(sizeof(int) * paramData->paramNum); paramData->paramFormats = malloc(sizeof(int) * paramData->paramNum); @@ -285,7 +285,7 @@ FLXQueryParamData; [self _destroyParamDataStructure:paramData]; // Probably justifies throwing an exception if we can't allocate any memory! - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain reason:@"Memory allocation error"]; + [PGPostgresException raise:PGPostgresConnectionErrorDomain reason:@"Memory allocation error"]; return nil; } @@ -299,7 +299,7 @@ FLXQueryParamData; * * @param paramData The parameter data to destroy. */ -- (void)_destroyParamDataStructure:(FLXQueryParamData *)paramData +- (void)_destroyParamDataStructure:(PGQueryParamData *)paramData { if (!paramData) return; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.h index 915b8c90..81cba455 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionQueryPreparation.h 3806 2012-09-07 09:57:31Z stuart02 $ // -// FLXPostgresConnectionQueryPreparation.h +// PGPostgresConnectionQueryPreparation.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,11 +20,11 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" +#import "PGPostgresConnection.h" -@interface FLXPostgresConnection (FLXPostgresConnectionQueryPreparation) +@interface PGPostgresConnection (PGPostgresConnectionQueryPreparation) -- (FLXPostgresStatement *)prepare:(NSString *)query; -- (FLXPostgresStatement *)prepareWithFormat:(NSString *)query, ...; +- (PGPostgresStatement *)prepare:(NSString *)query; +- (PGPostgresStatement *)prepareWithFormat:(NSString *)query, ...; @end diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.m index b2f80702..f773da42 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryPreparation.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionQueryPreparation.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionQueryPreparation.m 3848 2012-09-12 12:19:31Z stuart02 $ // -// FLXPostgresConnectionQueryPreparation.m +// PGPostgresConnectionQueryPreparation.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,13 +20,13 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnectionQueryPreparation.h" -#import "FLXPostgresConnectionTypeHandling.h" -#import "FLXPostgresKitPrivateAPI.h" -#import "FLXPostgresStatement.h" -#import "FLXPostgresException.h" +#import "PGPostgresConnectionQueryPreparation.h" +#import "PGPostgresConnectionTypeHandling.h" +#import "PGPostgresKitPrivateAPI.h" +#import "PGPostgresStatement.h" +#import "PGPostgresException.h" -@implementation FLXPostgresConnection (FLXPostgresConnectionQueryPreparation) +@implementation PGPostgresConnection (PGPostgresConnectionQueryPreparation) /** * Creates a prepared statment from the supplied query. @@ -35,11 +35,11 @@ * * @return The prepared statement instance. */ -- (FLXPostgresStatement *)prepare:(NSString *)query +- (PGPostgresStatement *)prepare:(NSString *)query { if (!query || ![query length]) return nil; - return [[[FLXPostgresStatement alloc] initWithStatement:query] autorelease]; + return [[[PGPostgresStatement alloc] initWithStatement:query] autorelease]; } /** @@ -50,7 +50,7 @@ * * @return The prepared statement instance. */ -- (FLXPostgresStatement *)prepareWithFormat:(NSString *)query, ... +- (PGPostgresStatement *)prepareWithFormat:(NSString *)query, ... { if (!query || ![query length]) return nil; @@ -61,7 +61,7 @@ va_end(args); - FLXPostgresStatement *statement = [self prepare:string]; + PGPostgresStatement *statement = [self prepare:string]; [string release]; @@ -80,7 +80,7 @@ * * @return A BOOL indicating succes. Returns NO if there's no statement, statement name or current connection. */ -- (BOOL)_prepare:(FLXPostgresStatement *)statement num:(NSInteger)paramNum types:(FLXPostgresOid *)paramTypes +- (BOOL)_prepare:(PGPostgresStatement *)statement num:(NSInteger)paramNum types:(PGPostgresOid *)paramTypes { if (!statement || ![statement name] || ![self isConnected]) return NO; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.h index 6567cd0b..11514df7 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionTypeHandling.h 3817 2012-09-08 08:57:46Z stuart02 $ // -// FLXPostgresConnectionTypeHandling.h +// PGPostgresConnectionTypeHandling.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on July 29, 2012. @@ -19,15 +19,15 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" -#import "FLXPostgresTypeHandlerProtocol.h" +#import "PGPostgresConnection.h" +#import "PGPostgresTypeHandlerProtocol.h" -@interface FLXPostgresConnection (FLXPostgresConnectionTypeHandling) +@interface PGPostgresConnection (PGPostgresConnectionTypeHandling) - (void)registerTypeHandlers; -- (id <FLXPostgresTypeHandlerProtocol>)typeHandlerForClass:(Class)class; -- (id <FLXPostgresTypeHandlerProtocol>)typeHandlerForRemoteType:(FLXPostgresOid)type; +- (id <PGPostgresTypeHandlerProtocol>)typeHandlerForClass:(Class)class; +- (id <PGPostgresTypeHandlerProtocol>)typeHandlerForRemoteType:(PGPostgresOid)type; - (void)registerTypeHandler:(Class)handlerClass; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.m index 483519cf..ddd6e745 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionTypeHandling.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionTypeHandling.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionTypeHandling.m 3803 2012-09-06 11:00:21Z stuart02 $ // -// FLXPostgresConnectionTypeHandling.m +// PGPostgresConnectionTypeHandling.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on July 29, 2012. @@ -19,13 +19,13 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnectionTypeHandling.h" -#import "FLXPostgresTypeStringHandler.h" -#import "FLXPostgresTypeNumberHandler.h" -#import "FLXPostgresTypeDateTimeHandler.h" -#import "FLXPostgresException.h" +#import "PGPostgresConnectionTypeHandling.h" +#import "PGPostgresTypeStringHandler.h" +#import "PGPostgresTypeNumberHandler.h" +#import "PGPostgresTypeDateTimeHandler.h" +#import "PGPostgresException.h" -@implementation FLXPostgresConnection (FLXPostgresConnectionTypeHandling) +@implementation PGPostgresConnection (PGPostgresConnectionTypeHandling) /** * Register all of our data type handlers for this connection. @@ -38,9 +38,9 @@ _typeMap = [[NSMutableDictionary alloc] init]; } - [self registerTypeHandler:[FLXPostgresTypeStringHandler class]]; - [self registerTypeHandler:[FLXPostgresTypeNumberHandler class]]; - [self registerTypeHandler:[FLXPostgresTypeDateTimeHandler class]]; + [self registerTypeHandler:[PGPostgresTypeStringHandler class]]; + [self registerTypeHandler:[PGPostgresTypeNumberHandler class]]; + [self registerTypeHandler:[PGPostgresTypeDateTimeHandler class]]; } /** @@ -50,7 +50,7 @@ * * @return The handler or nil if there's none associated with the class. */ -- (id <FLXPostgresTypeHandlerProtocol>)typeHandlerForClass:(Class)class +- (id <PGPostgresTypeHandlerProtocol>)typeHandlerForClass:(Class)class { return [_typeMap objectForKey:NSStringFromClass(class)]; } @@ -62,7 +62,7 @@ * * @return The handler or nil if there's none associated with the type. */ -- (id <FLXPostgresTypeHandlerProtocol>)typeHandlerForRemoteType:(FLXPostgresOid)type +- (id <PGPostgresTypeHandlerProtocol>)typeHandlerForRemoteType:(PGPostgresOid)type { return [_typeMap objectForKey:[NSNumber numberWithUnsignedInteger:type]]; } @@ -74,13 +74,13 @@ */ - (void)registerTypeHandler:(Class)handlerClass { - if (![handlerClass conformsToProtocol:@protocol(FLXPostgresTypeHandlerProtocol)]) { - [FLXPostgresException raise:FLXPostgresConnectionErrorDomain - reason:@"Class '%@' does not conform to protocol '%@'", NSStringFromClass(handlerClass), NSStringFromProtocol(@protocol(FLXPostgresTypeHandlerProtocol))]; + if (![handlerClass conformsToProtocol:@protocol(PGPostgresTypeHandlerProtocol)]) { + [PGPostgresException raise:PGPostgresConnectionErrorDomain + reason:@"Class '%@' does not conform to protocol '%@'", NSStringFromClass(handlerClass), NSStringFromProtocol(@protocol(PGPostgresTypeHandlerProtocol))]; } // Create an instance of this class - id <FLXPostgresTypeHandlerProtocol> handler = [[[handlerClass alloc] initWithConnection:self] autorelease]; + id <PGPostgresTypeHandlerProtocol> handler = [[[handlerClass alloc] initWithConnection:self] autorelease]; // Add to the type map - for native class [_typeMap setObject:handler forKey:NSStringFromClass([handler nativeClass])]; @@ -94,7 +94,7 @@ } } - FLXPostgresOid *remoteTypes = [handler remoteTypes]; + PGPostgresOid *remoteTypes = [handler remoteTypes]; for (NSUInteger i = 0; remoteTypes[i]; i++) { diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.h b/Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.h index 60eacfea..ae9c3201 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.h +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionUtils.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresConnectionUtils.h +// PGPostgresConnectionUtils.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,9 +20,9 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" +#import "PGPostgresConnection.h" -@interface FLXPostgresConnection (FLXPostgresConnectionUtils) +@interface PGPostgresConnection (PGPostgresConnectionUtils) - (NSArray *)schemas; - (NSArray *)databases; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.m b/Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.m index 73235766..30ad94a7 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionUtils.m +++ b/Frameworks/PostgresKit/Source/PGPostgresConnectionUtils.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresConnectionUtils.m 3806 2012-09-07 09:57:31Z stuart02 $ // -// FLXPostgresConnectionUtils.m +// PGPostgresConnectionUtils.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,17 +20,17 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnectionQueryPreparation.h" -#import "FLXPostgresConnectionQueryExecution.h" -#import "FLXPostgresResult.h" +#import "PGPostgresConnectionQueryPreparation.h" +#import "PGPostgresConnectionQueryExecution.h" +#import "PGPostgresResult.h" -@interface FLXPostgresConnection () +@interface PGPostgresConnection () - (NSArray *)_executeAndReturnResult:(NSString *)query; @end -@implementation FLXPostgresConnection (FLXPostgresConnectionUtils) +@implementation PGPostgresConnection (PGPostgresConnectionUtils) /** * Returns an array of all databases. @@ -81,7 +81,7 @@ NSString *join = @"\"information_schema\".\"table_constraints\" t INNER JOIN \"information_schema\".\"key_column_usage\" k ON t.\"constraint_name\" = k.\"constraint_name\""; NSString *where = [NSString stringWithFormat:@"t.\"constraint_type\" = 'PRIMARY KEY' AND t.\"table_catalog\" = '%@' AND t.\"table_schema\" = '%@' AND t.\"table_name\" = '%@'", [self database], schema, table]; - FLXPostgresResult *result = [self executeWithFormat:@"SELECT k.\"column_name\" FROM %@ WHERE %@", join, where]; + PGPostgresResult *result = [self executeWithFormat:@"SELECT k.\"column_name\" FROM %@ WHERE %@", join, where]; return [result numberOfRows] == 0 ? nil : [[result rowAsArray] objectAtIndex:0]; } @@ -113,7 +113,7 @@ */ - (NSArray *)_executeAndReturnResult:(NSString *)query { - FLXPostgresResult *result = [self execute:query]; + PGPostgresResult *result = [self execute:query]; if (!result || ![result numberOfRows]) return nil; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresError.h b/Frameworks/PostgresKit/Source/PGPostgresError.h index f3ee9c60..df41574d 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresError.h +++ b/Frameworks/PostgresKit/Source/PGPostgresError.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresError.h 3800 2012-09-06 09:26:47Z stuart02 $ // -// FLXPostgresError.h +// PGPostgresError.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 3, 2012. @@ -28,7 +28,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -@interface FLXPostgresError : NSObject +@interface PGPostgresError : NSObject { NSString *_errorSeverity; NSString *_errorStateCode; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresError.m b/Frameworks/PostgresKit/Source/PGPostgresError.m index 31024a92..bbf40fa1 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresError.m +++ b/Frameworks/PostgresKit/Source/PGPostgresError.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresError.m 3837 2012-09-09 12:25:03Z stuart02 $ // -// FLXPostgresError.m +// PGPostgresError.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 3, 2012. @@ -28,17 +28,17 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresError.h" -#import "FLXPostgresException.h" +#import "PGPostgresError.h" +#import "PGPostgresException.h" -@interface FLXPostgresError () +@interface PGPostgresError () - (void)_extractErrorDetailsFromResult:(const PGresult *)result; - (NSString *)_extractErrorField:(int)field fromResult:(const PGresult *)result; @end -@implementation FLXPostgresError +@implementation PGPostgresError @synthesize errorSeverity = _errorSeverity; @synthesize errorStateCode = _errorStateCode; @@ -51,7 +51,7 @@ - (id)init { - [FLXPostgresException raise:NSInternalInconsistencyException + [PGPostgresException raise:NSInternalInconsistencyException reason:@"%@ shouldn't be init'd directly; use initWithResult: instead.", [self className]]; return nil; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresException.h b/Frameworks/PostgresKit/Source/PGPostgresException.h index 54b781c4..1e586dad 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresException.h +++ b/Frameworks/PostgresKit/Source/PGPostgresException.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresException.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresException.h +// PGPostgresException.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,7 +20,7 @@ // License for the specific language governing permissions and limitations under // the License. -@interface FLXPostgresException : NSException +@interface PGPostgresException : NSException + (void)raise:(NSString *)name connection:(void *)connection; + (void)raise:(NSString *)name reason:(NSString *)reason, ...; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresException.m b/Frameworks/PostgresKit/Source/PGPostgresException.m index 266ac1a7..95a7ab9b 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresException.m +++ b/Frameworks/PostgresKit/Source/PGPostgresException.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresException.m 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresException.m +// PGPostgresException.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,9 +20,9 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresException.h" +#import "PGPostgresException.h" -@implementation FLXPostgresException +@implementation PGPostgresException /** * Raise a new exception with the supplied details. @@ -38,7 +38,7 @@ errorMessage = strlen(errorMessage) ? errorMessage : "Unknown error"; - [[[[FLXPostgresException alloc] initWithName:name reason:[NSString stringWithUTF8String:errorMessage] userInfo:nil] autorelease] raise]; + [[[[PGPostgresException alloc] initWithName:name reason:[NSString stringWithUTF8String:errorMessage] userInfo:nil] autorelease] raise]; } /** @@ -56,7 +56,7 @@ va_end(args); - [[[[FLXPostgresException alloc] initWithName:name reason:reasonMessage userInfo:nil] autorelease] raise]; + [[[[PGPostgresException alloc] initWithName:name reason:reasonMessage userInfo:nil] autorelease] raise]; [reasonMessage release]; } diff --git a/Frameworks/PostgresKit/Source/FLXPostgresKitPrivateAPI.h b/Frameworks/PostgresKit/Source/PGPostgresKitPrivateAPI.h index 1a564b91..6004039d 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresKitPrivateAPI.h +++ b/Frameworks/PostgresKit/Source/PGPostgresKitPrivateAPI.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresKitPrivateAPI.h 3828 2012-09-09 01:10:06Z stuart02 $ // -// FLXPostgresConnectionKitAPI.h +// PGPostgresConnectionKitAPI.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,22 +20,22 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresConnection.h" -#import "FLXPostgresTimeInterval.h" +#import "PGPostgresConnection.h" +#import "PGPostgresTimeInterval.h" -@interface FLXPostgresConnection () +@interface PGPostgresConnection () - (PGconn *)postgresConnection; @end -@interface FLXPostgresConnection (FLXPostgresConnectionQueryPreparationPrivateAPI) +@interface PGPostgresConnection (PGPostgresConnectionQueryPreparationPrivateAPI) -- (BOOL)_prepare:(FLXPostgresStatement *)statement num:(NSInteger)paramNum types:(FLXPostgresOid *)paramTypes; +- (BOOL)_prepare:(PGPostgresStatement *)statement num:(NSInteger)paramNum types:(PGPostgresOid *)paramTypes; @end -@interface FLXPostgresTimeInterval () +@interface PGPostgresTimeInterval () + (id)intervalWithPGInterval:(PGinterval *)interval; - (id)initWithInterval:(PGinterval *)interval; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresResult.h b/Frameworks/PostgresKit/Source/PGPostgresResult.h index 6f10c3e5..2bd1ba96 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresResult.h +++ b/Frameworks/PostgresKit/Source/PGPostgresResult.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresResult.h 3860 2012-09-24 11:36:57Z stuart02 $ // -// FLXPostgresResult.h +// PGPostgresResult.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,17 +20,17 @@ // License for the specific language governing permissions and limitations under // the License. -@class FLXPostgresConnection; +@class PGPostgresConnection; // Result set row types typedef enum { - FLXPostgresResultRowAsArray = 1, - FLXPostgresResultRowAsDictionary = 2 + PGPostgresResultRowAsArray = 1, + PGPostgresResultRowAsDictionary = 2 } -FLXPostgresResultRowType; +PGPostgresResultRowType; -@interface FLXPostgresResult : NSObject <NSFastEnumeration> +@interface PGPostgresResult : NSObject <NSFastEnumeration> { void *_result; void **_typeHandlers; @@ -43,9 +43,9 @@ FLXPostgresResultRowType; NSString **_fields; NSStringEncoding _stringEncoding; - FLXPostgresResultRowType _defaultRowType; + PGPostgresResultRowType _defaultRowType; - FLXPostgresConnection *_connection; + PGPostgresConnection *_connection; } /** @@ -66,9 +66,9 @@ FLXPostgresResultRowType; /** * @property defaultRowType The row type that should be used when calling -row. */ -@property (readwrite, assign) FLXPostgresResultRowType defaultRowType; +@property (readwrite, assign) PGPostgresResultRowType defaultRowType; -- (id)initWithResult:(void *)result connection:(FLXPostgresConnection *)connection; +- (id)initWithResult:(void *)result connection:(PGPostgresConnection *)connection; - (NSUInteger)numberOfFields; @@ -79,6 +79,6 @@ FLXPostgresResultRowType; - (id)row; - (NSArray *)rowAsArray; - (NSDictionary *)rowAsDictionary; -- (id)rowAsType:(FLXPostgresResultRowType)type; +- (id)rowAsType:(PGPostgresResultRowType)type; @end diff --git a/Frameworks/PostgresKit/Source/FLXPostgresResult.m b/Frameworks/PostgresKit/Source/PGPostgresResult.m index f2844faa..892e8a53 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresResult.m +++ b/Frameworks/PostgresKit/Source/PGPostgresResult.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresResult.m 3862 2012-09-24 12:58:47Z stuart02 $ // -// FLXPostgresResult.m +// PGPostgresResult.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,20 +20,20 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresResult.h" -#import "FLXPostgresException.h" -#import "FLXPostgresConnection.h" -#import "FLXPostgresConnectionTypeHandling.h" +#import "PGPostgresResult.h" +#import "PGPostgresException.h" +#import "PGPostgresConnection.h" +#import "PGPostgresConnectionTypeHandling.h" -@interface FLXPostgresResult () +@interface PGPostgresResult () - (void)_populateFields; - (id)_objectForRow:(NSUInteger)row column:(NSUInteger)column; -- (id <FLXPostgresTypeHandlerProtocol>)_typeHandlerForColumn:(NSUInteger)column withType:(FLXPostgresOid)type; +- (id <PGPostgresTypeHandlerProtocol>)_typeHandlerForColumn:(NSUInteger)column withType:(PGPostgresOid)type; @end -@implementation FLXPostgresResult +@implementation PGPostgresResult @synthesize numberOfRows = _numberOfRows; @synthesize numberOfFields = _numberOfFields; @@ -50,7 +50,7 @@ */ - (id)init { - [FLXPostgresException raise:NSInternalInconsistencyException reason:@"%@ shouldn't be init'd directly; use initWithResult:connection: instead.", [self className]]; + [PGPostgresException raise:NSInternalInconsistencyException reason:@"%@ shouldn't be init'd directly; use initWithResult:connection: instead.", [self className]]; return nil; } @@ -63,7 +63,7 @@ * * @return The result wrapper. */ -- (id)initWithResult:(void *)result connection:(FLXPostgresConnection *)connection +- (id)initWithResult:(void *)result connection:(PGPostgresConnection *)connection { if ((self = [super init])) { @@ -74,7 +74,7 @@ _connection = [connection retain]; _stringEncoding = [_connection stringEncoding]; - _defaultRowType = FLXPostgresResultRowAsDictionary; + _defaultRowType = PGPostgresResultRowAsDictionary; _typeHandlers = (void **)calloc(sizeof(void *), _numberOfFields); @@ -133,7 +133,7 @@ */ - (NSArray *)rowAsArray { - return [self rowAsType:FLXPostgresResultRowAsArray]; + return [self rowAsType:PGPostgresResultRowAsArray]; } /** @@ -143,7 +143,7 @@ */ - (NSDictionary *)rowAsDictionary { - return [self rowAsType:FLXPostgresResultRowAsDictionary]; + return [self rowAsType:PGPostgresResultRowAsDictionary]; } /** @@ -151,17 +151,17 @@ * * @return The data row as either an array or dictionary. */ -- (id)rowAsType:(FLXPostgresResultRowType)type +- (id)rowAsType:(PGPostgresResultRowType)type { if (_row >= _numberOfRows) return nil; - id data = (type == FLXPostgresResultRowAsArray) ? [NSMutableArray arrayWithCapacity:_numberOfFields] : [NSMutableDictionary dictionaryWithCapacity:_numberOfFields]; + id data = (type == PGPostgresResultRowAsArray) ? [NSMutableArray arrayWithCapacity:_numberOfFields] : [NSMutableDictionary dictionaryWithCapacity:_numberOfFields]; for (NSUInteger i = 0; i < _numberOfFields; i++) { id object = [self _objectForRow:(int)_row column:i]; - if (type == FLXPostgresResultRowAsArray) { + if (type == PGPostgresResultRowAsArray) { [(NSMutableArray *)data addObject:object]; } else { @@ -239,10 +239,10 @@ // Check for null if (PQgetisnull(_result, (int)row, (int)column)) return [NSNull null]; - FLXPostgresOid type = PQftype(_result, (int)column); + PGPostgresOid type = PQftype(_result, (int)column); // Get handler for this type - id <FLXPostgresTypeHandlerProtocol> handler = [self _typeHandlerForColumn:column withType:type]; + id <PGPostgresTypeHandlerProtocol> handler = [self _typeHandlerForColumn:column withType:type]; if (!handler) { NSLog(@"PostgresKit: Warning: No type handler found for type %d, return NSData.", type); @@ -274,7 +274,7 @@ * * @return The type handler or nil if out of this result's range. */ -- (id <FLXPostgresTypeHandlerProtocol>)_typeHandlerForColumn:(NSUInteger)column withType:(FLXPostgresOid)type +- (id <PGPostgresTypeHandlerProtocol>)_typeHandlerForColumn:(NSUInteger)column withType:(PGPostgresOid)type { if (column >= _numberOfFields) return nil; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresStatement.h b/Frameworks/PostgresKit/Source/PGPostgresStatement.h index fafbb8dc..70a6d7dd 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresStatement.h +++ b/Frameworks/PostgresKit/Source/PGPostgresStatement.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresStatement.h 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresStatement.h +// PGPostgresStatement.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,7 +20,7 @@ // License for the specific language governing permissions and limitations under // the License. -@interface FLXPostgresStatement : NSObject +@interface PGPostgresStatement : NSObject { NSString *_statement; NSString *_name; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.h b/Frameworks/PostgresKit/Source/PGPostgresTimeInterval.h index 74f14c41..5e08e2b3 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTimeInterval.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTimeInterval.h 3827 2012-09-09 00:51:43Z stuart02 $ // -// FLXPostgresTimeInterval.h +// PGPostgresTimeInterval.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 9, 2012. @@ -29,13 +29,13 @@ // OTHER DEALINGS IN THE SOFTWARE. /** - * @class FLXPostgresTimeInterval FLXPostgresTimeInterval.h + * @class PGPostgresTimeInterval PGPostgresTimeInterval.h * * @author Stuart Connolly http://stuconnolly.com * * Simple wrapper around libpqtypes' PQinterval structure. */ -@interface FLXPostgresTimeInterval : NSObject +@interface PGPostgresTimeInterval : NSObject { NSUInteger _microseconds; NSUInteger _seconds; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.m b/Frameworks/PostgresKit/Source/PGPostgresTimeInterval.m index 5acd7581..5c40ea52 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTimeInterval.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTimeInterval.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTimeInterval.m 3828 2012-09-09 01:10:06Z stuart02 $ // -// FLXPostgresTimeInterval.m +// PGPostgresTimeInterval.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 9, 2012. @@ -28,10 +28,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresTimeInterval.h" -#import "FLXPostgresKitPrivateAPI.h" +#import "PGPostgresTimeInterval.h" +#import "PGPostgresKitPrivateAPI.h" -@implementation FLXPostgresTimeInterval +@implementation PGPostgresTimeInterval @synthesize microseconds = _microseconds; @synthesize seconds = _seconds; @@ -45,7 +45,7 @@ + (id)intervalWithPGInterval:(PGinterval *)interval { - return [[[FLXPostgresTimeInterval alloc] initWithInterval:interval] autorelease]; + return [[[PGPostgresTimeInterval alloc] initWithInterval:interval] autorelease]; } - (id)initWithInterval:(PGinterval *)interval diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.h b/Frameworks/PostgresKit/Source/PGPostgresTimeTZ.h index dd58f57f..075ffbb0 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTimeTZ.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTimeTZ.h 3827 2012-09-09 00:51:43Z stuart02 $ // -// FLXPostgresTimeTZ.h +// PGPostgresTimeTZ.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 8, 2012. @@ -29,13 +29,13 @@ // OTHER DEALINGS IN THE SOFTWARE. /** - * @class FLXPostgresTimeTZ FLXPostgresTimeTZ.h + * @class PGPostgresTimeTZ PGPostgresTimeTZ.h * * @author Stuart Connolly http://stuconnolly.com * * Simple wrapper to represet a time or timestamp with an associated time zone. */ -@interface FLXPostgresTimeTZ : NSObject +@interface PGPostgresTimeTZ : NSObject { BOOL _hasDate; @@ -55,7 +55,7 @@ */ @property (readonly) NSTimeZone *timeZone; -+ (FLXPostgresTimeTZ *)timeWithDate:(NSDate *)date timeZoneGMTOffset:(NSUInteger)offset; ++ (PGPostgresTimeTZ *)timeWithDate:(NSDate *)date timeZoneGMTOffset:(NSUInteger)offset; - (id)initWithDate:(NSDate *)date timeZoneGMTOffset:(NSUInteger)offset; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.m b/Frameworks/PostgresKit/Source/PGPostgresTimeTZ.m index 692ef200..d2d91898 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTimeTZ.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTimeTZ.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTimeTZ.m 3827 2012-09-09 00:51:43Z stuart02 $ // -// FLXPostgresTimeTZ.m +// PGPostgresTimeTZ.m // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on September 8, 2012. @@ -28,9 +28,9 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. -#import "FLXPostgresTimeTZ.h" +#import "PGPostgresTimeTZ.h" -@implementation FLXPostgresTimeTZ +@implementation PGPostgresTimeTZ @synthesize hasDate = _hasDate; @synthesize date = _date; @@ -41,13 +41,13 @@ return [self initWithDate:[NSDate date] timeZoneGMTOffset:[[NSTimeZone systemTimeZone] secondsFromGMT]]; } -+ (FLXPostgresTimeTZ *)timeWithDate:(NSDate *)date timeZoneGMTOffset:(NSUInteger)offset ++ (PGPostgresTimeTZ *)timeWithDate:(NSDate *)date timeZoneGMTOffset:(NSUInteger)offset { - return [[[FLXPostgresTimeTZ alloc] initWithDate:date timeZoneGMTOffset:offset] autorelease]; + return [[[PGPostgresTimeTZ alloc] initWithDate:date timeZoneGMTOffset:offset] autorelease]; } /** - * Initialise a FLXPostgresTimeTZ with the supplied date and GMT offset. + * Initialise a PGPostgresTimeTZ with the supplied date and GMT offset. * * @param date The date to use. * @param offset The GMT offset in seconds that the associated time zone is. diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.h b/Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.h index 2aa084c2..6b9bf2f7 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeDateTimeHandler.h 3850 2012-09-13 09:05:50Z stuart02 $ // -// FLXPostgresTypeDateTimeHandler.h +// PGPostgresTypeDateTimeHandler.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,16 +20,16 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeHandler.h" +#import "PGPostgresTypeHandler.h" -@interface FLXPostgresTypeDateTimeHandler : FLXPostgresTypeHandler <FLXPostgresTypeHandlerProtocol> +@interface PGPostgresTypeDateTimeHandler : PGPostgresTypeHandler <PGPostgresTypeHandlerProtocol> { NSUInteger _row; NSUInteger _column; const PGresult *_result; - FLXPostgresOid _type; + PGPostgresOid _type; } /** @@ -45,7 +45,7 @@ /** * @property The type of data within the result the handler is being queried about. */ -@property (readwrite, assign) FLXPostgresOid type; +@property (readwrite, assign) PGPostgresOid type; /** * @property The result the handler is being asked to operate on. diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.m b/Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.m index 1a5081db..eb206587 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeDateTimeHandler.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeDateTimeHandler.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeDateTimeHandler.m 3866 2012-09-26 01:30:28Z stuart02 $ // -// FLXPostgresTypeDateTimeHandler.m +// PGPostgresTypeDateTimeHandler.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,28 +20,28 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeDateTimeHandler.h" -#import "FLXPostgresTypeNumberHandler.h" -#import "FLXPostgresConnectionParameters.h" -#import "FLXPostgresConnection.h" -#import "FLXPostgresConnectionTypeHandling.h" -#import "FLXPostgresTimeTZ.h" -#import "FLXPostgresTimeInterval.h" -#import "FLXPostgresKitPrivateAPI.h" +#import "PGPostgresTypeDateTimeHandler.h" +#import "PGPostgresTypeNumberHandler.h" +#import "PGPostgresConnectionParameters.h" +#import "PGPostgresConnection.h" +#import "PGPostgresConnectionTypeHandling.h" +#import "PGPostgresTimeTZ.h" +#import "PGPostgresTimeInterval.h" +#import "PGPostgresKitPrivateAPI.h" -static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = +static PGPostgresOid PGPostgresTypeDateTimeTypes[] = { - FLXPostgresOidDate, - FLXPostgresOidTime, - FLXPostgresOidTimeTZ, - FLXPostgresOidAbsTime, - FLXPostgresOidTimestamp, - FLXPostgresOidTimestampTZ, - FLXPostgresOidInterval, + PGPostgresOidDate, + PGPostgresOidTime, + PGPostgresOidTimeTZ, + PGPostgresOidAbsTime, + PGPostgresOidTimestamp, + PGPostgresOidTimestampTZ, + PGPostgresOidInterval, 0 }; -@interface FLXPostgresTypeDateTimeHandler () +@interface PGPostgresTypeDateTimeHandler () - (id)_timeFromResult; - (id)_timestmpFromResult; @@ -52,7 +52,7 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = @end -@implementation FLXPostgresTypeDateTimeHandler +@implementation PGPostgresTypeDateTimeHandler @synthesize row = _row; @synthesize type = _type; @@ -62,9 +62,9 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = #pragma mark - #pragma mark Protocol Implementation -- (FLXPostgresOid *)remoteTypes +- (PGPostgresOid *)remoteTypes { - return FLXPostgresTypeDateTimeTypes; + return PGPostgresTypeDateTimeTypes; } - (Class)nativeClass @@ -83,16 +83,16 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = switch (_type) { - case FLXPostgresOidDate: + case PGPostgresOidDate: return [self _dateFromResult]; - case FLXPostgresOidTime: - case FLXPostgresOidTimeTZ: - case FLXPostgresOidAbsTime: + case PGPostgresOidTime: + case PGPostgresOidTimeTZ: + case PGPostgresOidAbsTime: return [self _timeFromResult]; - case FLXPostgresOidTimestamp: - case FLXPostgresOidTimestampTZ: + case PGPostgresOidTimestamp: + case PGPostgresOidTimestampTZ: return [self _timestmpFromResult]; - case FLXPostgresOidInterval: + case PGPostgresOidInterval: return [self _timeIntervalFromResult]; } @@ -111,7 +111,7 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = { PGdate date; - if (!PQgetf(_result, (int)_row, FLXPostgresResultValueDate, (int)_column, &date)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, PGPostgresResultValueDate, (int)_column, &date)) return [NSNull null]; NSDateComponents *components = [[NSDateComponents alloc] init]; @@ -123,17 +123,17 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = } /** - * Converts a time interval value to a FLXPostgresTimeInterval instance. + * Converts a time interval value to a PGPostgresTimeInterval instance. * - * @return The FLXPostgresTimeInterval representation. + * @return The PGPostgresTimeInterval representation. */ - (id)_timeIntervalFromResult { PGinterval interval; - if (!PQgetf(_result, (int)_row, FLXPostgresResultValueInterval, (int)_column, &interval)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, PGPostgresResultValueInterval, (int)_column, &interval)) return [NSNull null]; - return [FLXPostgresTimeInterval intervalWithPGInterval:&interval]; + return [PGPostgresTimeInterval intervalWithPGInterval:&interval]; } /** @@ -147,9 +147,9 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = { PGtime pgTime; - BOOL hasTimeZone = _type == FLXPostgresOidTimeTZ; + BOOL hasTimeZone = _type == PGPostgresOidTimeTZ; - if (!PQgetf(_result, (int)_row, hasTimeZone ? FLXPostgresResultValueTimeTZ : FLXPostgresResultValueTime, (int)_column, &pgTime)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, hasTimeZone ? PGPostgresResultValueTimeTZ : PGPostgresResultValueTime, (int)_column, &pgTime)) return [NSNull null]; NSDateComponents *components = [[NSDateComponents alloc] init]; @@ -164,7 +164,7 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = NSDate *date = [self _dateFromComponents:components]; - return hasTimeZone ? (id)[FLXPostgresTimeTZ timeWithDate:date timeZoneGMTOffset:pgTime.gmtoff] : date; + return hasTimeZone ? (id)[PGPostgresTimeTZ timeWithDate:date timeZoneGMTOffset:pgTime.gmtoff] : date; } /** @@ -176,15 +176,15 @@ static FLXPostgresOid FLXPostgresTypeDateTimeTypes[] = { PGtimestamp timestamp; - BOOL hasTimeZone = _type == FLXPostgresOidTimestampTZ; + BOOL hasTimeZone = _type == PGPostgresOidTimestampTZ; - if (!PQgetf(_result, (int)_row, hasTimeZone ? FLXPostgresResultValueTimestmpTZ : FLXPostgresResultValueTimestamp, (int)_column, ×tamp)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, hasTimeZone ? PGPostgresResultValueTimestmpTZ : PGPostgresResultValueTimestamp, (int)_column, ×tamp)) return [NSNull null]; - FLXPostgresTimeTZ *timestampTZ = nil; + PGPostgresTimeTZ *timestampTZ = nil; NSDate *date = [NSDate dateWithTimeIntervalSince1970:timestamp.epoch]; if (hasTimeZone) { - timestampTZ = [FLXPostgresTimeTZ timeWithDate:date timeZoneGMTOffset:timestamp.time.gmtoff]; + timestampTZ = [PGPostgresTimeTZ timeWithDate:date timeZoneGMTOffset:timestamp.time.gmtoff]; [timestampTZ setHasDate:YES]; } diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.h b/Frameworks/PostgresKit/Source/PGPostgresTypeHandler.h index 3bfdac39..5fe9c567 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeHandler.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeHandler.h 3848 2012-09-12 12:19:31Z stuart02 $ // -// FLXPostgresTypeHandler.h +// PGPostgresTypeHandler.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on July 27, 2012. @@ -19,20 +19,20 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeHandlerProtocol.h" +#import "PGPostgresTypeHandlerProtocol.h" -@class FLXPostgresConnection; +@class PGPostgresConnection; -@interface FLXPostgresTypeHandler : NSObject +@interface PGPostgresTypeHandler : NSObject { - FLXPostgresConnection *_connection; + PGPostgresConnection *_connection; } /** * @property connection The connection this type handler is associated with. */ -@property (readonly) FLXPostgresConnection *connection; +@property (readonly) PGPostgresConnection *connection; -- (id)initWithConnection:(FLXPostgresConnection *)connection; +- (id)initWithConnection:(PGPostgresConnection *)connection; @end diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.m b/Frameworks/PostgresKit/Source/PGPostgresTypeHandler.m index 2f232307..49cdd01a 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandler.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeHandler.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeHandler.m 3848 2012-09-12 12:19:31Z stuart02 $ // -// FLXPostgresTypeHandler.h +// PGPostgresTypeHandler.h // PostgresKit // // Created by Stuart Connolly (stuconnolly.com) on July 27, 2012. @@ -19,15 +19,15 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeHandler.h" +#import "PGPostgresTypeHandler.h" -@implementation FLXPostgresTypeHandler +@implementation PGPostgresTypeHandler @synthesize connection = _connection; #pragma mark - -- (id)initWithConnection:(FLXPostgresConnection *)connection +- (id)initWithConnection:(PGPostgresConnection *)connection { if ((self = [super init])) { _connection = [connection retain]; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandlerProtocol.h b/Frameworks/PostgresKit/Source/PGPostgresTypeHandlerProtocol.h index c750ba3d..5c8dab83 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeHandlerProtocol.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeHandlerProtocol.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeHandlerProtocol.h 3850 2012-09-13 09:05:50Z stuart02 $ // -// FLXPostgresTypeHandlerProtocol.h +// PGPostgresTypeHandlerProtocol.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,12 +20,12 @@ // License for the specific language governing permissions and limitations under // the License. -@class FLXPostgresConnection; +@class PGPostgresConnection; /** - * @protocol FLXPostgresTypeHandlerProtocol + * @protocol PGPostgresTypeHandlerProtocol */ -@protocol FLXPostgresTypeHandlerProtocol +@protocol PGPostgresTypeHandlerProtocol /** * @property The row within the result the handler is being queried about. @@ -40,7 +40,7 @@ /** * @property The type of data within the result the handler is being queried about. */ -@property (readwrite, assign) FLXPostgresOid type; +@property (readwrite, assign) PGPostgresOid type; /** * @property The result the handler is being asked to operate on. @@ -50,9 +50,9 @@ /** * The remote type values handled by this class (terminated by 0). * - * @return The remote types as an array of FLXPostgresOid's. + * @return The remote types as an array of PGPostgresOid's. */ -- (FLXPostgresOid *)remoteTypes; +- (PGPostgresOid *)remoteTypes; /** * What is the native class this class handles. diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.h b/Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.h index 73cc9d1e..c454bb92 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeNumberHandler.h 3850 2012-09-13 09:05:50Z stuart02 $ // -// FLXPostgresTypeNumberHandler.h +// PGPostgresTypeNumberHandler.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,16 +20,16 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeHandler.h" +#import "PGPostgresTypeHandler.h" -@interface FLXPostgresTypeNumberHandler : FLXPostgresTypeHandler <FLXPostgresTypeHandlerProtocol> +@interface PGPostgresTypeNumberHandler : PGPostgresTypeHandler <PGPostgresTypeHandlerProtocol> { NSUInteger _row; NSUInteger _column; const PGresult *_result; - FLXPostgresOid _type; + PGPostgresOid _type; } /** @@ -45,7 +45,7 @@ /** * @property The type of data within the result the handler is being queried about. */ -@property (readwrite, assign) FLXPostgresOid type; +@property (readwrite, assign) PGPostgresOid type; /** * @property The result the handler is being asked to operate on. diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.m b/Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.m index a8fbc631..106fce21 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeNumberHandler.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeNumberHandler.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeNumberHandler.m 3867 2012-09-26 02:45:14Z stuart02 $ // -// FLXPostgresTypeNumberHandler.m +// PGPostgresTypeNumberHandler.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,23 +20,23 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeNumberHandler.h" +#import "PGPostgresTypeNumberHandler.h" -static FLXPostgresOid FLXPostgresTypeNumberTypes[] = +static PGPostgresOid PGPostgresTypeNumberTypes[] = { - FLXPostgresOidInt8, - FLXPostgresOidInt2, - FLXPostgresOidInt4, - FLXPostgresOidFloat4, - FLXPostgresOidFloat8, - FLXPostgresOidBool, - FLXPostgresOidOid, - FLXPostgresOidMoney, - FLXPostgresOidNumeric, + PGPostgresOidInt8, + PGPostgresOidInt2, + PGPostgresOidInt4, + PGPostgresOidFloat4, + PGPostgresOidFloat8, + PGPostgresOidBool, + PGPostgresOidOid, + PGPostgresOidMoney, + PGPostgresOidNumeric, 0 }; -@interface FLXPostgresTypeNumberHandler () +@interface PGPostgresTypeNumberHandler () - (id)_integerObjectFromResult; - (id)_floatObjectFromResult; @@ -45,7 +45,7 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = @end -@implementation FLXPostgresTypeNumberHandler +@implementation PGPostgresTypeNumberHandler @synthesize row = _row; @synthesize type = _type; @@ -55,9 +55,9 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = #pragma mark - #pragma mark Protocol Implementation -- (FLXPostgresOid *)remoteTypes +- (PGPostgresOid *)remoteTypes { - return FLXPostgresTypeNumberTypes; + return PGPostgresTypeNumberTypes; } - (Class)nativeClass @@ -76,16 +76,16 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = switch (_type) { - case FLXPostgresOidInt8: - case FLXPostgresOidInt2: - case FLXPostgresOidInt4: + case PGPostgresOidInt8: + case PGPostgresOidInt2: + case PGPostgresOidInt4: return [self _integerObjectFromResult]; - case FLXPostgresOidFloat4: - case FLXPostgresOidFloat8: + case PGPostgresOidFloat4: + case PGPostgresOidFloat8: return [self _floatObjectFromResult]; - case FLXPostgresOidBool: + case PGPostgresOidBool: return [self _booleanObjectFromResult]; - case FLXPostgresOidNumeric: + case PGPostgresOidNumeric: return [self _numericFromResult]; } @@ -113,15 +113,15 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = switch (length) { case 2: - if (!PQgetf(_result, _row, FLXPostgresResultValueInt2, &int2)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueInt2, &int2)) return [NSNull null]; return [NSNumber numberWithShort:int2]; case 4: - if (!PQgetf(_result, _row, FLXPostgresResultValueInt4, &int4)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueInt4, &int4)) return [NSNull null]; return [NSNumber numberWithInteger:int4]; case 8: - if (!PQgetf(_result, _row, FLXPostgresResultValueInt8, &int8)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueInt8, &int8)) return [NSNull null]; return [NSNumber numberWithLongLong:int8]; } @@ -149,11 +149,11 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = switch (length) { case 4: - if (!PQgetf(_result, _row, FLXPostgresResultValueFloat4, &float4)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueFloat4, &float4)) return [NSNull null]; return [NSNumber numberWithFloat:float4]; case 8: - if (!PQgetf(_result, _row, FLXPostgresResultValueFloat8, &float8)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueFloat8, &float8)) return [NSNull null]; return [NSNumber numberWithDouble:float8]; } @@ -173,7 +173,7 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = { PGbool b; - if (!PQgetf(_result, _row, FLXPostgresResultValueBool, &b)) return [NSNull null]; + if (!PQgetf(_result, _row, PGPostgresResultValueBool, &b)) return [NSNull null]; return [NSNumber numberWithInt:b]; } @@ -190,7 +190,7 @@ static FLXPostgresOid FLXPostgresTypeNumberTypes[] = { PGnumeric numeric; - if (!PQgetf(_result, (int)_row, FLXPostgresResultValueNumeric, (int)_column, &numeric)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, PGPostgresResultValueNumeric, (int)_column, &numeric)) return [NSNull null]; NSString *stringValue = [[NSString alloc] initWithUTF8String:numeric]; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.h b/Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.h index 9b0e8d8b..e5edd7c7 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.h +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.h @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeStringHandler.h 3850 2012-09-13 09:05:50Z stuart02 $ // -// FLXPostgresTypeStringHandler.h +// PGPostgresTypeStringHandler.h // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,16 +20,16 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeHandler.h" +#import "PGPostgresTypeHandler.h" -@interface FLXPostgresTypeStringHandler : FLXPostgresTypeHandler <FLXPostgresTypeHandlerProtocol> +@interface PGPostgresTypeStringHandler : PGPostgresTypeHandler <PGPostgresTypeHandlerProtocol> { NSUInteger _row; NSUInteger _column; const PGresult *_result; - FLXPostgresOid _type; + PGPostgresOid _type; } /** @@ -45,7 +45,7 @@ /** * @property The type of data within the result the handler is being queried about. */ -@property (readwrite, assign) FLXPostgresOid type; +@property (readwrite, assign) PGPostgresOid type; /** * @property The result the handler is being asked to operate on. diff --git a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m b/Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.m index 725153a7..f638eb4e 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresTypeStringHandler.m +++ b/Frameworks/PostgresKit/Source/PGPostgresTypeStringHandler.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresTypeStringHandler.m 3866 2012-09-26 01:30:28Z stuart02 $ // -// FLXPostgresTypeStringHandler.m +// PGPostgresTypeStringHandler.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,29 +20,29 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresTypeStringHandler.h" -#import "FLXPostgresConnection.h" +#import "PGPostgresTypeStringHandler.h" +#import "PGPostgresConnection.h" #import <netdb.h> -static FLXPostgresOid FLXPostgresTypeStringTypes[] = +static PGPostgresOid PGPostgresTypeStringTypes[] = { - FLXPostgresOidText, - FLXPostgresOidChar, - FLXPostgresOidName, - FLXPostgresOidVarChar, - FLXPostgresOidXML, - FLXPostgresOidUUID, - FLXPostgresOidBit, - FLXPostgresOidVarBit, - FLXPostgresOidInetAddr, - FLXPostgresOidCidrAddr, - FLXPostgresOidMacAddr, - FLXPostgresOidUnknown, + PGPostgresOidText, + PGPostgresOidChar, + PGPostgresOidName, + PGPostgresOidVarChar, + PGPostgresOidXML, + PGPostgresOidUUID, + PGPostgresOidBit, + PGPostgresOidVarBit, + PGPostgresOidInetAddr, + PGPostgresOidCidrAddr, + PGPostgresOidMacAddr, + PGPostgresOidUnknown, 0 }; -@interface FLXPostgresTypeStringHandler () +@interface PGPostgresTypeStringHandler () - (id)_stringFromResult; - (id)_macAddressFromResult; @@ -50,7 +50,7 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] = @end -@implementation FLXPostgresTypeStringHandler +@implementation PGPostgresTypeStringHandler @synthesize row = _row; @synthesize type = _type; @@ -60,9 +60,9 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] = #pragma mark - #pragma mark Protocol Implementation -- (FLXPostgresOid *)remoteTypes +- (PGPostgresOid *)remoteTypes { - return FLXPostgresTypeStringTypes; + return PGPostgresTypeStringTypes; } - (Class)nativeClass @@ -81,20 +81,20 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] = switch (_type) { - case FLXPostgresOidText: - case FLXPostgresOidChar: - case FLXPostgresOidName: - case FLXPostgresOidVarChar: - case FLXPostgresOidXML: - case FLXPostgresOidUUID: - case FLXPostgresOidBit: - case FLXPostgresOidVarBit: - case FLXPostgresOidUnknown: + case PGPostgresOidText: + case PGPostgresOidChar: + case PGPostgresOidName: + case PGPostgresOidVarChar: + case PGPostgresOidXML: + case PGPostgresOidUUID: + case PGPostgresOidBit: + case PGPostgresOidVarBit: + case PGPostgresOidUnknown: return [self _stringFromResult]; - case FLXPostgresOidMacAddr: + case PGPostgresOidMacAddr: return [self _macAddressFromResult]; - case FLXPostgresOidInetAddr: - case FLXPostgresOidCidrAddr: + case PGPostgresOidInetAddr: + case PGPostgresOidCidrAddr: return [self _inetAddressFromResult]; } @@ -128,7 +128,7 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] = { PGmacaddr address; - if (!PQgetf(_result, (int)_row, FLXPostgresResultValueMacAddr, (int)_column, &address)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, PGPostgresResultValueMacAddr, (int)_column, &address)) return [NSNull null]; return [NSString stringWithFormat:@"%02d:%02d:%02d:%02d:%02d:%02d", address.a, address.b, address.c, address.d, address.e, address.f]; } @@ -142,7 +142,7 @@ static FLXPostgresOid FLXPostgresTypeStringTypes[] = { PGinet inet; - if (!PQgetf(_result, (int)_row, _type == FLXPostgresOidInetAddr ? FLXPostgresResultValueInet : FLXPostgresResultValueCidr, (int)_column, &inet)) return [NSNull null]; + if (!PQgetf(_result, (int)_row, _type == PGPostgresOidInetAddr ? PGPostgresResultValueInet : PGPostgresResultValueCidr, (int)_column, &inet)) return [NSNull null]; char ip[80]; struct sockaddr *sa = (struct sockaddr *)inet.sa_buf; diff --git a/Frameworks/PostgresKit/Source/PGPostgresTypes.h b/Frameworks/PostgresKit/Source/PGPostgresTypes.h new file mode 100644 index 00000000..993e824d --- /dev/null +++ b/Frameworks/PostgresKit/Source/PGPostgresTypes.h @@ -0,0 +1,119 @@ +// +// $Id: PGPostgresTypes.h 3861 2012-09-24 12:23:27Z stuart02 $ +// +// PGPostgresTypes.h +// PostgresKit +// +// Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com +// +// Forked by the Sequel Pro Team on July 22, 2012. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +#import "postgres_ext.h" + +// Generic PostgreSQL object ID +typedef Oid PGPostgresOid; + +// See PostgreSQL source: include/catalog/pg_type.h + +enum +{ + // BOOL + PGPostgresOidBool = 16, // NumberHandler => NSNumber + PGPostgresOidByteData = 17, // Currently not supported + + // Text + PGPostgresOidName = 19, // StringHandler => NSString + + // Integers + PGPostgresOidInt8 = 20, // NumberHandler => NSNumber + PGPostgresOidInt2 = 21, // NumberHandler => NSNumber + PGPostgresOidInt4 = 23, // NumberHandler => NSNumber + + // Text + PGPostgresOidText = 25, // StringHandler => NSString + + // OID + PGPostgresOidOid = 26, // NumberHandler => NSNumber + + // XML + PGPostgresOidXML = 142, // StringHandler => NSString + + // Geometric + PGPostgresOidPoint = 600, // Currently not supported + PGPostgresOidLSeg = 601, // Currently not supported + PGPostgresOidPath = 602, // Currently not supported + PGPostgresOidBox = 603, // Currently not supported + PGPostgresOidPolygon = 604, // Currently not supported + + // Network + PGPostgresOidCidrAddr = 650, // StringHandler => NSString + + // Float + PGPostgresOidFloat4 = 700, // NumberHandler => NSNumber + PGPostgresOidFloat8 = 701, // NumberHandler => NSNumber + + // ABS Time + PGPostgresOidAbsTime = 702, // DateHandler => NSDate + + // What! + PGPostgresOidUnknown = 705, // StringHandler => NSString + + // Geometric + PGPostgresOidCircle = 718, // Currently not supported + + // Monetary + PGPostgresOidMoney = 790, // NumberHandler => NSNumber + + // Network + PGPostgresOidMacAddr = 829, // StringHandler => NSString + PGPostgresOidInetAddr = 869, // StringHandler => NSString + + // Arrays + PGPostgresOidArrayBool = 1000, // Currently not supported + PGPostgresOidArrayData = 1001, // Currently not supported + PGPostgresOidArrayChar = 1002, // Currently not supported + PGPostgresOidArrayName = 1003, // Currently not supported + PGPostgresOidArrayInt2 = 1005, // Currently not supported + PGPostgresOidArrayInt4 = 1007, // Currently not supported + PGPostgresOidArrayText = 1009, // Currently not supported + PGPostgresOidArrayVarchar = 1015, // Currently not supported + PGPostgresOidArrayInt8 = 1016, // Currently not supported + PGPostgresOidArrayFloat4 = 1021, // Currently not supported + PGPostgresOidArrayFloat8 = 1022, // Currently not supported + PGPostgresOidArrayMacAddr = 1040, // Currently not supported + PGPostgresOidArrayIPAddr = 1041, // Currently not supported + + // Text + PGPostgresOidChar = 1042, // StringHandler => NSString + PGPostgresOidVarChar = 1043, // StringHandler => NSString + + // Date/time + PGPostgresOidDate = 1082, // DateHandler => NSDate + PGPostgresOidTime = 1083, // DateHandler => NSDate + PGPostgresOidTimestamp = 1114, // DateHandler => NSDate + PGPostgresOidTimestampTZ = 1184, // DateHandler => PGPostgresTimeTZ + PGPostgresOidInterval = 1186, // DateHandler => PGPostgresTimeInterval + PGPostgresOidTimeTZ = 1266, // DateHandler => PGPostgresTimeTZ + + // Bit strings + PGPostgresOidBit = 1560, // StringHandler => NSString + PGPostgresOidVarBit = 1562, // StringHandler => NSString + + // Numeric + PGPostgresOidNumeric = 1700, // NumberHandler => NSNumber + + // UUID + PGPostgresOidUUID = 2950 // StringHandler => NSString +}; diff --git a/Frameworks/PostgresKit/Source/FLXPostgresStatement.m b/Frameworks/PostgresKit/Source/PGostgresStatement.m index a1505ccd..5e0d1959 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresStatement.m +++ b/Frameworks/PostgresKit/Source/PGostgresStatement.m @@ -1,7 +1,7 @@ // -// $Id$ +// $Id: PGPostgresStatement.m 3793 2012-09-03 10:22:17Z stuart02 $ // -// FLXPostgresStatement.m +// PGPostgresStatement.m // PostgresKit // // Copyright (c) 2008-2009 David Thorpe, djt@mutablelogic.com @@ -20,9 +20,9 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresStatement.h" +#import "PGPostgresStatement.h" -@implementation FLXPostgresStatement +@implementation PGPostgresStatement @synthesize name = _name; @synthesize statement = _statement; diff --git a/Frameworks/PostgresKit/Source/PostgresKit-Prefix.pch b/Frameworks/PostgresKit/Source/PostgresKit-Prefix.pch index 093e3126..ac7904dd 100644 --- a/Frameworks/PostgresKit/Source/PostgresKit-Prefix.pch +++ b/Frameworks/PostgresKit/Source/PostgresKit-Prefix.pch @@ -30,8 +30,8 @@ #import "libpqtypes.h" // Framework constants - #import "FLXConstants.h" + #import "PGConstants.h" // Global types - #import "FLXPostgresTypes.h" + #import "PGPostgresTypes.h" #endif diff --git a/Frameworks/PostgresKit/Source/PostgresKit.h b/Frameworks/PostgresKit/Source/PostgresKit.h index 40c86169..4189fffe 100644 --- a/Frameworks/PostgresKit/Source/PostgresKit.h +++ b/Frameworks/PostgresKit/Source/PostgresKit.h @@ -18,11 +18,11 @@ // License for the specific language governing permissions and limitations under // the License. -#import "FLXPostgresError.h" -#import "FLXPostgresResult.h" -#import "FLXPostgresStatement.h" -#import "FLXPostgresException.h" -#import "FLXPostgresConnection.h" -#import "FLXPostgresConnectionUtils.h" -#import "FLXPostgresConnectionQueryExecution.h" -#import "FLXPostgresConnectionQueryPreparation.h" +#import "PGPostgresError.h" +#import "PGPostgresResult.h" +#import "PGPostgresStatement.h" +#import "PGPostgresException.h" +#import "PGPostgresConnection.h" +#import "PGPostgresConnectionUtils.h" +#import "PGPostgresConnectionQueryExecution.h" +#import "PGPostgresConnectionQueryPreparation.h" |