aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseInfo.h
diff options
context:
space:
mode:
authordrx777 <david.rekowski@gmx.de>2010-04-28 17:11:41 +0000
committerdrx777 <david.rekowski@gmx.de>2010-04-28 17:11:41 +0000
commitf36685ae1bee7b9274de27414ab8b64dbc57770f (patch)
tree269b242812332fab9bfdbe37955fbfbe72a87def /Source/SPDatabaseInfo.h
parent29b42d1c3b751781fb70684f5bb779001d19b1f3 (diff)
downloadsequelpro-f36685ae1bee7b9274de27414ab8b64dbc57770f.tar.gz
sequelpro-f36685ae1bee7b9274de27414ab8b64dbc57770f.tar.bz2
sequelpro-f36685ae1bee7b9274de27414ab8b64dbc57770f.zip
This changeset implements renaming and duplicating databases on a server. Details as follows:
* altered MCPConnection listTablesFromDB:like: to return NSArray * altered MCPConnection listFieldsFromTable:like: to use backtick quoted strings for table and fieldnames * added MCPConnection listTablesFromDB for a complete table list * added SPStringAdditions.h to various files to prevent warnings * added sheets for duplicate/rename DB in DBView.xib * added duplicate/rename menu items to MainMenu.xib * added outlets in TableDocument: databaseNewSheet databaseRenameSheet databaseCopyNameField databaseRenameNameField copyOnlyStructureButton copyDatabaseButton renameDatabaseButton * added methods in TableDocument: getConnection, copyDatabase, renameDatabase, _copyDatabase, _renameDatabase * added OCMock Framework for object mocking in tests * added group Others/DatabaseActions
Diffstat (limited to 'Source/SPDatabaseInfo.h')
-rw-r--r--Source/SPDatabaseInfo.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/SPDatabaseInfo.h b/Source/SPDatabaseInfo.h
new file mode 100644
index 00000000..e71863eb
--- /dev/null
+++ b/Source/SPDatabaseInfo.h
@@ -0,0 +1,54 @@
+//
+// SPDatabaseInfo.h
+// sequel-pro
+//
+// Created by David Rekowski on 19.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MCPConnection.h"
+#import "MCPResult.h"
+
+/*
+ * The SPDatabaseInfo class provides means of retrieving a list of database names
+ */
+@interface SPDatabaseInfo : NSObject {
+ MCPConnection *connection;
+ NSObject *parent;
+}
+
+/**
+ * @property MCPConnection references the MCPKit connection to MySQL; it has to be set.
+ */
+@property (retain) MCPConnection *connection;
+
+/**
+ * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages
+ */
+@property (retain) NSObject *parent;
+
+/**
+ * This method checks, whether a database exists.
+ *
+ * @param databaseName the name of the database to check
+ * @result TRUE if it exists, otherwise FALSE
+ */
+-(BOOL)databaseExists:(NSString *)databaseName;
+
+/**
+ * This method retrieves a list of all databases.
+ *
+ * @result NSArray databaseNames
+ */
+- (NSArray *)listDBs;
+
+/**
+ * This method retrieves a list of databases like the given string
+ *
+ * @param NSString dbsName name of the database substring to match
+ * @result NSArray databaseNames
+ */
+- (NSArray *)listDBsLike:(NSString *)dbsName;
+
+@end