From 79eff5bf42154da8d7730e0e0159160f68ec4e16 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 14 Mar 2012 01:16:18 +0000 Subject: =?UTF-8?q?Final=20feature=20work=20on=20the=20SPMySQL=20branch=20?= =?UTF-8?q?before=20merging:=20=20-=20Add=20a=20ping=20keepalive=20managin?= =?UTF-8?q?g=20object=20to=20prevent=20retain=20cycles=20from=20the=20NSTi?= =?UTF-8?q?mer=20=20-=20Add=20-[SPMySQLConnection=20copy]=20support=20=20-?= =?UTF-8?q?=20Refactor=20Hans-J=C3=B6rg=20Bibiko's=20database=20structure?= =?UTF-8?q?=20retrieval,=20moving=20it=20out=20of=20the=20MySQL=20framewor?= =?UTF-8?q?k=20and=20building=20it=20around=20a=20copy=20of=20the=20connec?= =?UTF-8?q?tion.=20=20This=20reduces=20the=20amount=20of=20connections-ove?= =?UTF-8?q?r-time=20used=20by=20Sequel=20Pro=20to=20two=20constant=20conne?= =?UTF-8?q?ctions=20(addressing=20Issue=20#1097)=20and=20improves=20robust?= =?UTF-8?q?ness.=20=20-=20Use=20the=20database=20structure=20retrieval=20c?= =?UTF-8?q?onnection=20for=20faster=20query=20cancellation=20without=20an?= =?UTF-8?q?=20extra=20connection=20required,=20if=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPDatabaseStructure.h | 57 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Source/SPDatabaseStructure.h (limited to 'Source/SPDatabaseStructure.h') diff --git a/Source/SPDatabaseStructure.h b/Source/SPDatabaseStructure.h new file mode 100644 index 00000000..2b2d6977 --- /dev/null +++ b/Source/SPDatabaseStructure.h @@ -0,0 +1,57 @@ +// +// $Id$ +// +// SPDatabaseStructure.h +// sequel-pro +// +// Created by Hans-Jörg Bibiko on March 25, 2010 +// Copyright (c) 2010 Hans-Jörg Bibiko. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// More info at + +@class SPMySQLConnection, SPDatabaseDocument; + +@interface SPDatabaseStructure : NSObject { + SPDatabaseDocument *delegate; + SPMySQLConnection *mySQLConnection; + + NSMutableDictionary *structure; + NSMutableArray *allKeysofDbStructure; + + NSMutableArray *structureRetrievalThreads; + + pthread_mutex_t threadManagementLock; + pthread_mutex_t dataLock; + pthread_mutex_t connectionCheckLock; +} + +// Setup +- (id)initWithDelegate:(SPDatabaseDocument *)theDelegate; +- (void)setConnectionToClone:(SPMySQLConnection *)aConnection; + +// Information +- (SPMySQLConnection *)connection; + +// Structure retrieval from the server +- (void)queryDbStructureWithUserInfo:(NSDictionary*)userInfo; +- (BOOL)isQueryingDatabaseStructure; + +// Structure information +- (NSDictionary *)structure; +- (NSArray *)allStructureKeys; + +@end -- cgit v1.2.3