From cc3c436432e592d15c46a4a9e38c6cb689eca0ee Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 20 Feb 2012 00:51:47 +0000 Subject: Initial commit of the new SPMySQL Framework, which is added to the project and ready for use but not yet integrated. This new framework should provide much of the functionality required from MCPKit and is based around its interface for relatively easy integration. The largest missing component is Hans' structure code which I believe is better placed outside the framework. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the Readme file: The SPMySQL Framework is intended to provide a stable MySQL connection framework, with the ability to run text-based queries and rapidly retrieve result sets with conversion from MySQL data types to Cocoa objects. SPMySQL.framework has an interface loosely based around that provided by MCPKit by Serge Cohen and Bertrand Mansion (http://mysql-cocoa.sourceforge.net/), and in particular the heavily modified Sequel Pro version (http://www.sequelpro.com/). It is a full rewrite of the original framework, although it includes code from patches implementing the following Sequel Pro functionality, largely contributed by Hans-Jörg Bibiko, Stuart Connolly, Jakob Egger, and Rowan Beentje: - Connection locking (Jakob et al) - Ping & keepalive (Rowan et al) - Query cancellation (Rowan et al) - Delegate setup (Stuart et al) - SSL support (Rowan et al) - Connection checking (Rowan et al) - Version state (Stuart et al) - Maximum packet size control (Hans et al) - Result multithreading and streaming (Rowan et al) - Improved encoding support & switching (Rowan et al) - Database structure; moved to inside the app (Hans et al) - Query reattempts and error-handling approach (Rowan et al) - Geometry result class (Hans et al) - Connection proxy (Stuart et al) --- .../build/Release/SPMySQL.framework/Headers | 1 + .../build/Release/SPMySQL.framework/Resources | 1 + .../build/Release/SPMySQL.framework/SPMySQL | 1 + .../Versions/A/Headers/Databases & Tables.h | 49 ++++++ .../Versions/A/Headers/Delegate & Proxy.h | 36 +++++ .../Versions/A/Headers/Encoding.h | 53 ++++++ .../Versions/A/Headers/Field Definitions.h | 38 +++++ .../Versions/A/Headers/Max Packet Size.h | 40 +++++ .../Versions/A/Headers/Querying & Preparation.h | 103 ++++++++++++ .../SPMySQL.framework/Versions/A/Headers/SPMySQL.h | 62 ++++++++ .../Versions/A/Headers/SPMySQLConnection.h | 177 +++++++++++++++++++++ .../Versions/A/Headers/SPMySQLConnectionDelegate.h | 106 ++++++++++++ .../Versions/A/Headers/SPMySQLConnectionProxy.h | 77 +++++++++ .../Versions/A/Headers/SPMySQLConstants.h | 76 +++++++++ .../A/Headers/SPMySQLFastStreamingResult.h | 47 ++++++ .../Versions/A/Headers/SPMySQLGeometryData.h | 53 ++++++ .../Versions/A/Headers/SPMySQLResult.h | 120 ++++++++++++++ .../Versions/A/Headers/SPMySQLStreamingResult.h | 54 +++++++ .../Versions/A/Headers/Server Info.h | 50 ++++++ .../A/Resources/English.lproj/InfoPlist.strings | Bin 0 -> 92 bytes .../Versions/A/Resources/Info.plist | 40 +++++ .../Release/SPMySQL.framework/Versions/A/SPMySQL | Bin 0 -> 2249976 bytes .../Release/SPMySQL.framework/Versions/Current | 1 + 23 files changed, 1185 insertions(+) create mode 120000 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Headers create mode 120000 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Resources create mode 120000 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/SPMySQL create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Databases & Tables.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Delegate & Proxy.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Encoding.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Field Definitions.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Max Packet Size.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Querying & Preparation.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQL.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnection.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionDelegate.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionProxy.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConstants.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLFastStreamingResult.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLGeometryData.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLResult.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLStreamingResult.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Server Info.h create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings create mode 100644 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/Info.plist create mode 100755 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/SPMySQL create mode 120000 Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/Current (limited to 'Frameworks/SPMySQLFramework/build/Release') diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Headers b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Headers new file mode 120000 index 00000000..a177d2a6 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Resources b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Resources new file mode 120000 index 00000000..953ee36f --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/SPMySQL b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/SPMySQL new file mode 120000 index 00000000..3a3ed2eb --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/SPMySQL @@ -0,0 +1 @@ +Versions/Current/SPMySQL \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Databases & Tables.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Databases & Tables.h new file mode 100644 index 00000000..332b2680 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Databases & Tables.h @@ -0,0 +1,49 @@ +// +// $Id$ +// +// Databases & Tables.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 11, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLConnection (Databases_and_Tables) + +// Database selection +- (BOOL)selectDatabase:(NSString *)aDatabase; + +// Database lists +- (NSArray *)databases; +- (NSArray *)databasesLike:(NSString *)nameLikeString; + +// Table lists +- (NSArray *)tables; +- (NSArray *)tablesLike:(NSString *)nameLikeString; +- (NSArray *)tablesFromDatabase:(NSString *)aDatabase; +- (NSArray *)tablesLike:(NSString *)nameLikeString fromDatabase:(NSString *)aDatabase; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Delegate & Proxy.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Delegate & Proxy.h new file mode 100644 index 00000000..cf132fcf --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Delegate & Proxy.h @@ -0,0 +1,36 @@ +// +// $Id$ +// +// Delegate & Proxy.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 9, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLConnection (Delegate_and_Proxy) + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Encoding.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Encoding.h new file mode 100644 index 00000000..bb5bf25d --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Encoding.h @@ -0,0 +1,53 @@ +// +// $Id$ +// +// Encoding.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 14, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLConnection (Encoding) + +// Current connection encoding information +- (NSString *)encoding; +- (NSStringEncoding)stringEncoding; +- (BOOL)encodingUsesLatin1Transport; + +// Setting connection encoding +- (BOOL)setEncoding:(NSString *)theEncoding; +- (BOOL)setEncodingUsesLatin1Transport:(BOOL)useLatin1; + +// Encoding storage and restoration +- (void)storeEncodingForRestoration; +- (void)restoreStoredEncoding; + +// Encoding conversion ++ (NSStringEncoding)stringEncodingForMySQLCharset:(const char *)mysqlCharset; ++ (NSString *)mySQLCharsetForStringEncoding:(NSStringEncoding)aStringEncoding; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Field Definitions.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Field Definitions.h new file mode 100644 index 00000000..20e1ddc9 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Field Definitions.h @@ -0,0 +1,38 @@ +// +// $Id$ +// +// Field Definitions.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 2, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLResult (Field_Definitions) + +- (NSArray *)fieldDefinitions; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Max Packet Size.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Max Packet Size.h new file mode 100644 index 00000000..faa667d8 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Max Packet Size.h @@ -0,0 +1,40 @@ +// +// $Id$ +// +// Max Packet Size.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 9, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLConnection (Max_Packet_Size) + +- (NSUInteger)maxQuerySize; +- (BOOL)isMaxQuerySizeEditable; +- (NSUInteger)setGlobalMaxQuerySize:(NSUInteger)newMaxSize; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Querying & Preparation.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Querying & Preparation.h new file mode 100644 index 00000000..ff55f796 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Querying & Preparation.h @@ -0,0 +1,103 @@ +// +// $Id$ +// +// Querying & Preparation.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 14, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLConnection (Querying_and_Preparation) + +// Data preparation +- (NSString *)escapeAndQuoteString:(NSString *)theString; +- (NSString *)escapeString:(NSString *)theString includingQuotes:(BOOL)includeQuotes; +- (NSString *)escapeAndQuoteData:(NSData *)theData; +- (NSString *)escapeData:(NSData *)theData includingQuotes:(BOOL)includeQuotes; + +// Queries +- (SPMySQLResult *)queryString:(NSString *)theQueryString; +- (SPMySQLFastStreamingResult *)streamingQueryString:(NSString *)theQueryString; +- (id)streamingQueryString:(NSString *)theQueryString useLowMemoryBlockingStreaming:(BOOL)fullStreaming; +- (id)queryString:(NSString *)theQueryString usingEncoding:(NSStringEncoding)theEncoding withResultType:(SPMySQLResultType)theReturnType; + +// Query information +- (unsigned long long)rowsAffectedByLastQuery; +- (unsigned long long)lastInsertID; + +// Connection and query error state +- (BOOL)queryErrored; +- (NSString *)lastErrorMessage; +- (NSUInteger)lastErrorID; ++ (BOOL)isErrorIDConnectionError:(NSUInteger)theErrorID; + +// Query cancellation +- (void)cancelCurrentQuery; +- (BOOL)lastQueryWasCancelled; +- (BOOL)lastQueryWasCancelledUsingReconnect; + +@end + +/** + * Set up static functions to allow fast calling with cached selectors + */ + +static inline id SPMySQLConnectionEscapeString(SPMySQLConnection* self, NSString *theString, BOOL encloseInQuotes) +{ + typedef id (*SPMySQLConnectionEscapeStringMethodPtr)(SPMySQLConnection*, SEL, NSString *, BOOL); + static SPMySQLConnectionEscapeStringMethodPtr cachedMethodPointer; + static SEL cachedSelector; + + if (!cachedSelector) cachedSelector = @selector(escapeString:includingQuotes:); + if (!cachedMethodPointer) cachedMethodPointer = (SPMySQLConnectionEscapeStringMethodPtr)[self methodForSelector:cachedSelector]; + + return cachedMethodPointer(self, cachedSelector, theString, encloseInQuotes); +} + +static inline id SPMySQLConnectionEscapeData(SPMySQLConnection* self, NSData *theData, BOOL encloseInQuotes) +{ + typedef id (*SPMySQLConnectionEscapeDataMethodPtr)(SPMySQLConnection*, SEL, NSData *, BOOL); + static SPMySQLConnectionEscapeDataMethodPtr cachedMethodPointer; + static SEL cachedSelector; + + if (!cachedSelector) cachedSelector = @selector(escapeData:includingQuotes:); + if (!cachedMethodPointer) cachedMethodPointer = (SPMySQLConnectionEscapeDataMethodPtr)[self methodForSelector:cachedSelector]; + + return cachedMethodPointer(self, cachedSelector, theData, encloseInQuotes); +} + +static inline id SPMySQLConnectionQueryString(SPMySQLConnection* self, NSString *theQueryString, NSStringEncoding theEncoding, SPMySQLResultType theReturnType) +{ + typedef id (*SPMySQLConnectionQueryStringMethodPtr)(SPMySQLConnection*, SEL, NSString *, NSStringEncoding, SPMySQLResultType); + static SPMySQLConnectionQueryStringMethodPtr cachedMethodPointer; + static SEL cachedSelector; + + if (!cachedSelector) cachedSelector = @selector(queryString:usingEncoding:withResultType:); + if (!cachedMethodPointer) cachedMethodPointer = (SPMySQLConnectionQueryStringMethodPtr)[self methodForSelector:cachedSelector]; + + return cachedMethodPointer(self, cachedSelector, theQueryString, theEncoding, theReturnType); +} \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQL.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQL.h new file mode 100644 index 00000000..a9150f46 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQL.h @@ -0,0 +1,62 @@ +// +// $Id$ +// +// SPMySQL.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 22, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +@class SPMySQLConnection, SPMySQLResult, SPMySQLStreamingResult, SPMySQLFastStreamingResult; + +// Global include file for the framework. +// Constants +#import "SPMySQLConstants.h" + +// Required category additions +#import "SPMySQLStringAdditions.h" + +// MySQL Connection Delegate and Proxy protocols +#import "SPMySQLConnectionDelegate.h" +#import "SPMySQLConnectionProxy.h" + +// MySQL Connection class and public categories +#import "SPMySQLConnection.h" +#import "Delegate & Proxy.h" +#import "Databases & Tables.h" +#import "Max Packet Size.h" +#import "Querying & Preparation.h" +#import "Encoding.h" +#import "Server Info.h" + +// MySQL result set, streaming subclasses of same, and associated categories +#import "SPMySQLResult.h" +#import "SPMySQLStreamingResult.h" +#import "SPMySQLFastStreamingResult.h" +#import "Field Definitions.h" + +// Result data objects +#import "SPMySQLGeometryData.h" \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnection.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnection.h new file mode 100644 index 00000000..db6dc0af --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnection.h @@ -0,0 +1,177 @@ +// +// $Id$ +// +// SPMySQLConnection.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 8, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +@interface SPMySQLConnection : NSObject { + + // Delegate + NSObject *delegate; + BOOL delegateSupportsWillQueryString; + BOOL delegateSupportsConnectionLost; + BOOL delegateQueryLogging; // Defaults to YES if protocol implemented + + // Basic connection details + NSString *host; + NSString *username; + NSString *password; + NSUInteger port; + BOOL useSocket; + NSString *socketPath; + + // SSL connection details + BOOL useSSL; + NSString *sslKeyFilePath; + NSString *sslCertificatePath; + NSString *sslCACertificatePath; + + // MySQL connection details and state + struct st_mysql *mySQLConnection; + SPMySQLConnectionState state; + BOOL connectedWithSSL; + BOOL userTriggeredDisconnect; + BOOL isReconnecting; + uint64_t initialConnectTime; + unsigned long mysqlConnectionThreadId; + + // Connection proxy + NSObject *proxy; + SPMySQLConnectionProxyState previousProxyState; + BOOL proxyStateChangeNotificationsIgnored; + + // Connection lock to prevent non-thread-safe query misuse + NSConditionLock *connectionLock; + + // Currently selected database + NSString *database; + + // Delegate connection lost decisions + NSUInteger reconnectionRetryAttempts; + SPMySQLConnectionLostDecision lastDelegateDecisionForLostConnection; + NSLock *delegateDecisionLock; + + // Timeout and keep-alive + NSUInteger timeout; + BOOL useKeepAlive; + NSTimer *keepAliveTimer; + CGFloat keepAliveInterval; + uint64_t lastKeepAliveTime; + NSUInteger keepAlivePingFailures; + pthread_t keepAlivePingThread; + BOOL keepAlivePingThreadActive; + BOOL keepAliveLastPingSuccess; + BOOL keepAliveLastPingBlocked; + + // Encoding details - and also a record of any previous encoding to allow + // switching back and forth + NSString *encoding; + NSStringEncoding stringEncoding; + BOOL encodingUsesLatin1Transport; + NSString *previousEncoding; + BOOL previousEncodingUsesLatin1Transport; + + // Server details + NSString *serverVersionString; + + // Error state for the last query or connection state + NSUInteger queryErrorID; + NSString *queryErrorMessage; + + // Query details + unsigned long long lastQueryAffectedRowCount; + unsigned long long lastQueryInsertID; + + // Query cancellation details + BOOL lastQueryWasCancelled; + BOOL lastQueryWasCancelledUsingReconnect; + + // Timing details + uint64_t lastConnectionUsedTime; + double lastQueryExecutionTime; + + // Maximum query size + NSUInteger maxQuerySize; + BOOL maxQuerySizeIsEditable; + BOOL maxQuerySizeEditabilityChecked; + NSUInteger queryActionShouldRestoreMaxQuerySize; + + // Queries + BOOL retryQueriesOnConnectionFailure; +} + +#pragma mark - +#pragma mark Synthesized properties + +@property (readwrite, assign, nonatomic) NSObject *delegate; +@property (readwrite, assign, nonatomic) NSObject *proxy; + +@property (readwrite, retain) NSString *host; +@property (readwrite, retain) NSString *username; +@property (readwrite, retain) NSString *password; +@property (readwrite, assign) NSUInteger port; +@property (readwrite, assign) BOOL useSocket; +@property (readwrite, retain) NSString *socketPath; + +@property (readwrite, assign) BOOL useSSL; +@property (readwrite, retain) NSString *sslKeyFilePath; +@property (readwrite, retain) NSString *sslCertificatePath; +@property (readwrite, retain) NSString *sslCACertificatePath; + +@property (readwrite, assign) NSUInteger timeout; +@property (readwrite, assign) BOOL useKeepAlive; +@property (readwrite, assign) CGFloat keepAliveInterval; + +@property (readonly) unsigned long mysqlConnectionThreadId; +@property (readwrite, assign) BOOL retryQueriesOnConnectionFailure; + +@property (readwrite, assign) BOOL delegateQueryLogging; + +#pragma mark - +#pragma mark Connection and disconnection + +- (BOOL)connect; +- (BOOL)reconnect; +- (void)disconnect; + +#pragma mark - +#pragma mark Connection state + +- (BOOL)isConnected; +- (BOOL)isConnectedViaSSL; +- (BOOL)checkConnection; +- (double)timeConnected; +- (BOOL)userTriggeredDisconnect; + +#pragma mark - +#pragma mark Connection utility + ++ (NSString *)findSocketPath; + +@end \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionDelegate.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionDelegate.h new file mode 100644 index 00000000..f1a1f911 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionDelegate.h @@ -0,0 +1,106 @@ +// +// $Id$ +// +// SPMySQLConnectionDelegate.h +// SPMySQLFramework +// +// Created by Stuart Connolly (stuconnolly.com) on October 20, 2010. +// Copyright (c) 2010 Stuart Connolly. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +@protocol SPMySQLConnectionDelegate +@optional + +/** + * Notifies the delegate that a query will be performed. + * + * @param query The query string that will be sent to the MySQL server + * @param connection The connection instance performing the query + */ +- (void)willQueryString:(NSString *)query connection:(id)connection; + +/** + * Notifies the delegate that a query that was just performed gave + * an error. + * + * @param error The query error, as a string + * @param connection The connection instance which received the error + */ +- (void)queryGaveError:(NSString *)error connection:(id)connection; + +/** + * Notifies the delegate that it should display the supplied error. + * The connection may sometimes want to notify the user directly + * about certain issues, and will use this method to allow the + * delegate to do so. + * + * @param title The title of the message to display to the user + * @param message The main text of the message to display to the user + */ +- (void)showErrorWithTitle:(NSString *)title message:(NSString *)message; + +/** + * Requests the keychain password for the connection. + * When a connection is being made to a server, it is best not to + * set the password on the class; instead, it should be kept within + * the secure store, and the other connection details (user, host) + * can be used to look it up and supplied on demand. + * + * @param connection The connection instance to supply the password for + */ +- (NSString *)keychainPasswordForConnection:(id)connection; + +/** + * Notifies the delegate that no underlying connection is available, + * typically when the connection has been asked to perform a query + * or some other action for which a connection must be present. + * Those actions will still return false or error states as appropriate, + * but the delegate may wish to perform actions as a result of a total + * loss of connection. + * + * @param connection The connection instance which has lost the connection to the host + */ +- (void)noConnectionAvailable:(id)connection; + +/** + * Notifies the delegate that although a SSL connection was requested, + * MySQL made the connection without using SSL. This can happen because + * the server connected to doesn't support SSL or had it disabled, or + * that insufficient details were provided to make the connection over + * SSL. + */ +- (void)connectionFellBackToNonSSL:(id)connection; + +/** + * Notifies the delegate that the connection has been temporarily lost, + * and asks the delegate for guidance on how to proceed. If the delegate + * does not implement this method, reconnections will automatically be + * attempted - up to a small limit of attempts. + * + * @param connection The connection instance that requires a decision on how to proceed + */ +- (SPMySQLConnectionLostDecision)connectionLost:(id)connection; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionProxy.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionProxy.h new file mode 100644 index 00000000..afd7c95a --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConnectionProxy.h @@ -0,0 +1,77 @@ +// +// $Id$ +// +// SPMySQLConnectionProxy.h +// SPMySQLFramework +// +// Created by Stuart Connolly (stuconnolly.com) on July 2, 2009. +// Copyright (c) 2009 Stuart Connolly. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +/** + * Connection proxy state constants. + */ +typedef enum { + SPMySQLProxyIdle = 0, + SPMySQLProxyConnecting = 1, + SPMySQLProxyWaitingForAuth = 2, + SPMySQLProxyConnected = 3, + SPMySQLProxyForwardingFailed = 4 +} SPMySQLConnectionProxyState; + + +@protocol SPMySQLConnectionProxy + +/** + * All the methods for this protocol are required. + */ + +/** + * Connect the proxy. + */ +- (void)connect; + +/** + * Disconnect the proxy. + */ +- (void)disconnect; + +/** + * Get the current state of the proxy. + */ +- (SPMySQLConnectionProxyState)state; + +/** + * Get the local port being provided by the proxy. + */ +- (NSUInteger)localPort; + +/** + * Sets the method the proxy should call whenever the state of the connection changes. + */ +- (BOOL)setConnectionStateChangeSelector:(SEL)theStateChangeSelector delegate:(id)theDelegate; + +@end \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConstants.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConstants.h new file mode 100644 index 00000000..6fb3d279 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLConstants.h @@ -0,0 +1,76 @@ +// +// $Id$ +// +// SPMySQLConstants.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 14, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +// Connection state +typedef enum { + SPMySQLDisconnected = 0, + SPMySQLConnecting = 1, + SPMySQLConnected = 2, + SPMySQLDisconnecting = 3 +} SPMySQLConnectionState; + +// Connection lock state +typedef enum { + SPMySQLConnectionIdle = 0, + SPMySQLConnectionBusy = 1 +} SPMySQLConnectionLockState; + +// Decision on how to handle lost connections +// Connection check constants +typedef enum { + SPMySQLConnectionLostDisconnect = 0, + SPMySQLConnectionLostReconnect = 1 +} SPMySQLConnectionLostDecision; + +// Result set row types +typedef enum { + SPMySQLResultRowAsDefault = 0, + SPMySQLResultRowAsArray = 1, + SPMySQLResultRowAsDictionary = 2 +} SPMySQLResultRowType; + +// Result charset list +typedef struct { + NSUInteger nr; + const char *name; + const char *collation; + NSUInteger char_minlen; + NSUInteger char_maxlen; +} SPMySQLResultCharset; + +// Query result types +typedef enum { + SPMySQLResultAsResult = 0, + SPMySQLResultAsFastStreamingResult = 1, + SPMySQLResultAsLowMemStreamingResult = 2 +} SPMySQLResultType; \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLFastStreamingResult.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLFastStreamingResult.h new file mode 100644 index 00000000..a4f07cdd --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLFastStreamingResult.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +// SPMySQLFastStreamingResult.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 2, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLFastStreamingResult : SPMySQLStreamingResult { + + // Linked list setup + struct st_spmysqlstreamingrowdata *currentDataStoreEntry; + struct st_spmysqlstreamingrowdata *lastDataStoreEntry; + + // Additional counts and memory length tracking + NSUInteger processedRowCount; + + // Thread safety + pthread_mutex_t dataLock; +} + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLGeometryData.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLGeometryData.h new file mode 100644 index 00000000..e1313032 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLGeometryData.h @@ -0,0 +1,53 @@ +// +// $Id$ +// +// SPMySQLGeometryData.h +// sequel-pro +// +// Created by Hans-Jörg Bibiko on October 07, 2010 +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +@interface SPMySQLGeometryData : NSObject +{ + // Holds the WKB bytes coming from SQL server + Byte *geoBuffer; + + // Holds the buffer length + NSUInteger bufferLength; + +} + +- (id)initWithBytes:(const void *)geoData length:(NSUInteger)length; ++ (id)dataWithBytes:(const void *)geoData length:(NSUInteger)length; +- (NSString *)description; +- (NSUInteger)length; +- (NSData *)data; +- (NSString *)wktString; +- (NSDictionary *)coordinates; +- (NSInteger)wkbType; +- (NSString *)wktType; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLResult.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLResult.h new file mode 100644 index 00000000..baddf8aa --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLResult.h @@ -0,0 +1,120 @@ +// +// $Id$ +// +// SPMySQLResult.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 26, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + + +typedef enum { + SPMySQLResultFieldAsUnhandled = 0, + SPMySQLResultFieldAsString = 1, + SPMySQLResultFieldAsStringOrBlob = 2, + SPMySQLResultFieldAsBlob = 3, + SPMySQLResultFieldAsBit = 4, + SPMySQLResultFieldAsGeometry = 5, + SPMySQLResultFieldAsNull = 6 +} SPMySQLResultFieldProcessor; + +@interface SPMySQLResult : NSObject { + + // Wrapped MySQL result set and its encoding + struct st_mysql_res *resultSet; + NSStringEncoding stringEncoding; + + // Number of fields in the result set, and the field names and information + NSUInteger numberOfFields; + struct st_mysql_field *fieldDefinitions; + unsigned int *fieldTypes; + NSString **fieldNames; + + // Number of rows in the result set and an internal data position counter + unsigned long long numberOfRows; + unsigned long long currentRowIndex; + + // How long it took to execute the query that produced this result + double queryExecutionTime; + + // The target result set type for fast enumeration and unspecified row retrieval + SPMySQLResultRowType defaultRowReturnType; + + // Whether all data should be returned as strings - useful for working with some older server types + BOOL returnDataAsStrings; +} + +// Master init method +- (id)initWithMySQLResult:(void *)theResult stringEncoding:(NSStringEncoding)theStringEncoding; + +// Result set information +- (NSUInteger)numberOfFields; +- (unsigned long long)numberOfRows; + +// Column information +- (NSArray *)fieldNames; + +// Data retrieval (note that fast enumeration is also supported, using instance-default format) +- (void)seekToRow:(unsigned long long)targetRow; +- (id)getRow; +- (NSArray *)getRowAsArray; +- (NSDictionary *)getRowAsDictionary; +- (id)getRowAsType:(SPMySQLResultRowType)theType; + +// Data conversion ++ (NSString *)bitStringWithBytes:(const char *)bytes length:(NSUInteger)length padToLength:(NSUInteger)padLength; + +#pragma mark - +#pragma mark Synthesized properties + +/** + * Set whether the result should return data types as strings. This may be useful + * for queries where the result may be returned in either string or data form, but + * will be converted to string for display and use anyway. + * Note that certain MySQL versions also return data types for strings - eg SHOW + * commands like SHOW CREATE TABLE or SHOW VARIABLES, and this conversion can be + * necessary there. + */ +@property (readwrite, assign) BOOL returnDataAsStrings; + +@property (readwrite, assign) SPMySQLResultRowType defaultRowReturnType; + +@end + +/** + * Set up a static function to allow fast calling with cached selectors + */ +static inline id SPMySQLResultGetRow(SPMySQLResult* self, SPMySQLResultRowType rowType) +{ + typedef id (*SPMySQLResultGetRowMethodPtr)(SPMySQLResult*, SEL, SPMySQLResultRowType); + static SPMySQLResultGetRowMethodPtr cachedMethodPointer; + static SEL cachedSelector; + + if (!cachedSelector) cachedSelector = @selector(getRowAsType:); + if (!cachedMethodPointer) cachedMethodPointer = (SPMySQLResultGetRowMethodPtr)[self methodForSelector:cachedSelector]; + + return cachedMethodPointer(self, cachedSelector, rowType); +} \ No newline at end of file diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLStreamingResult.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLStreamingResult.h new file mode 100644 index 00000000..5abb85db --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/SPMySQLStreamingResult.h @@ -0,0 +1,54 @@ +// +// $Id$ +// +// SPMySQLStreamingResult.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on February 18, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +@interface SPMySQLStreamingResult : SPMySQLResult { + + // Keep a link to the parent connection for locking purposes + SPMySQLConnection *parentConnection; + + // Streaming result information and tracking + BOOL connectionUnlocked; + BOOL dataDownloaded; + + // Counts and memory length tracking + NSUInteger downloadedRowCount; + + IMP isConnectedPtr; + SEL isConnectedSelector; +} + +- (id)initWithMySQLResult:(void *)theResult stringEncoding:(NSStringEncoding)theStringEncoding connection:(SPMySQLConnection *)theConnection; + +// Allow result fetching to be cancelled +- (void)cancelResultLoad; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Server Info.h b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Server Info.h new file mode 100644 index 00000000..d8f5f183 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Headers/Server Info.h @@ -0,0 +1,50 @@ +// +// $Id$ +// +// Server Info.h +// SPMySQLFramework +// +// Created by Rowan Beentje (rowan.beent.je) on January 14, 2012 +// Copyright (c) 2012 Rowan Beentje. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// +// More info at + +@class SPMySQLResult; + +@interface SPMySQLConnection (Server_Info) + +// Server version information +- (NSString *)serverVersionString; +- (NSUInteger)serverMajorVersion; +- (NSUInteger)serverMinorVersion; +- (NSUInteger)serverReleaseVersion; + +// Server version comparisons +- (BOOL)serverVersionIsGreaterThanOrEqualTo:(NSUInteger)aMajorVersion minorVersion:(NSUInteger)aMinorVersion releaseVersion:(NSUInteger)aReleaseVersion; + +// Server tasks & processes +- (SPMySQLResult *)listProcesses; +- (BOOL)killQueryOnThreadID:(unsigned long)theThreadID; + +@end diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings new file mode 100644 index 00000000..dea12de4 Binary files /dev/null and b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings differ diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/Info.plist b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/Info.plist new file mode 100644 index 00000000..6f7e4285 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,40 @@ + + + + + BuildMachineOSBuild + 11D50b + CFBundleDevelopmentRegion + English + CFBundleExecutable + SPMySQL + CFBundleIdentifier + com.yourcompany.SPMySQL + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SPMySQL + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + SPDT + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 10M2518 + DTPlatformVersion + PG + DTSDKBuild + 9L31a + DTSDKName + macosx10.5 + DTXcode + 0400 + DTXcodeBuild + 10M2518 + + diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/SPMySQL b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/SPMySQL new file mode 100755 index 00000000..d5483d58 Binary files /dev/null and b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/A/SPMySQL differ diff --git a/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/Current b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/Current new file mode 120000 index 00000000..8c7e5a66 --- /dev/null +++ b/Frameworks/SPMySQLFramework/build/Release/SPMySQL.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file -- cgit v1.2.3