aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-16 12:09:44 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-16 12:09:44 +0000
commitc178775a335d5e6292088c4c692f53832a129fd3 (patch)
tree7cde846197f245e2f8702641e572c85b34666f92 /Source/SPDatabaseDocument.m
parent697440c0e14c20ea719fbded60d5df1bed4330d0 (diff)
downloadsequelpro-c178775a335d5e6292088c4c692f53832a129fd3.tar.gz
sequelpro-c178775a335d5e6292088c4c692f53832a129fd3.tar.bz2
sequelpro-c178775a335d5e6292088c4c692f53832a129fd3.zip
• Bundle support
- further simplifications and centralizations - runBashCommandWithEnvironment: now it can execute each script command whose first line begins with #!/... natively - added some more shell variables
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m52
1 files changed, 52 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 837c5387..4ef38ef8 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -4548,6 +4548,58 @@
NSLog(@"received: %@", commandDict);
}
+- (NSDictionary*)shellVariables
+{
+ NSMutableDictionary *env = [NSMutableDictionary dictionary];
+
+ if (tablesListInstance) {
+ if([tablesListInstance selectedDatabase])
+ [env setObject:[tablesListInstance selectedDatabase] forKey:@"SP_SELECTED_DATABASE"];
+
+ if ([tablesListInstance tableName])
+ [env setObject:[tablesListInstance tableName] forKey:@"SP_SELECTED_TABLE"];
+
+ if ([tablesListInstance selectedTableItems])
+ [env setObject:[[tablesListInstance selectedTableItems] componentsJoinedByString:@"\t"] forKey:@"SP_SELECTED_TABLES"];
+
+ if ([tablesListInstance allDatabaseNames])
+ [env setObject:[[tablesListInstance allDatabaseNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_DATABASES"];
+
+ if ([tablesListInstance allTableNames])
+ [env setObject:[[tablesListInstance allTableNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_TABLES"];
+
+ if ([tablesListInstance allViewNames])
+ [env setObject:[[tablesListInstance allViewNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_VIEWS"];
+
+ if ([tablesListInstance allFunctionNames])
+ [env setObject:[[tablesListInstance allFunctionNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_FUNCTIONS"];
+
+ if ([tablesListInstance allProcedureNames])
+ [env setObject:[[tablesListInstance allProcedureNames] componentsJoinedByString:@"\t"] forKey:@"SP_ALL_PROCEDURES"];
+
+ if ([self user])
+ [env setObject:[self user] forKey:@"SP_CURRENT_USER"];
+
+ if ([self host])
+ [env setObject:[self host] forKey:@"SP_CURRENT_HOST"];
+
+ if ([self port])
+ [env setObject:[self port] forKey:@"SP_CURRENT_PORT"];
+
+ if ([self databaseEncoding])
+ [env setObject:[self databaseEncoding] forKey:@"SP_DATABASE_ENCODING"];
+
+ }
+
+ if(1)
+ [env setObject:@"mysql" forKey:@"SP_RDBMS_TYPE"];
+
+ if([self mySQLVersion])
+ [env setObject:[self mySQLVersion] forKey:@"SP_RDBMS_VERSION"];
+
+ return (NSDictionary*)env;
+}
+
#pragma mark -
#pragma mark Text field delegate methods