From 7f66ab71ca1cdd2bea637cc546837c28fbdd78ab Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 17 Aug 2009 00:10:02 +0000 Subject: Rework SQL export: - Added an MCPStreamingResult class to MCPKit, to allow streaming results from the server including fast array access of each row - Tweak SQL export to use the streaming result class and to keep memory usage lower End result is generally faster exports, more accurate progress bars, and much much lower (and consistent) memory usage. --- .../MCPKit/MCPFoundationKit/MCPStreamingResult.h | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h new file mode 100644 index 00000000..168f85d3 --- /dev/null +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h @@ -0,0 +1,41 @@ +// +// $Id$ +// +// MCPStreamingResult.h +// sequel-pro +// +// Created by Rowan Beentje on Aug 16, 2009 +// Copyright 2009 Rowan Beentje. 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 + +#import +#import "MCPResult.h" + +@class MCPConnection; + +@interface MCPStreamingResult : MCPResult +{ + MCPConnection *parentConnection; + + MYSQL_FIELD *fieldDefinitions; +} + +- (id)initWithMySQLPtr:(MYSQL *)mySQLPtr encoding:(NSStringEncoding)theEncoding timeZone:(NSTimeZone *)theTimeZone connection:(MCPConnection *)theConnection; +- (NSArray *)fetchNextRowAsArray; + +@end -- cgit v1.2.3