aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableSource.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r--Source/TableSource.m19
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m
index 92aa9811..de6bca6c 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -91,7 +91,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab
[tableFields setArray:[self fetchResultAsArray:tableSourceResult]];
[tableSourceResult release];
- indexResult = [[mySQLConnection queryString:[NSString stringWithFormat:@"SHOW INDEX FROM %@", [selectedTable backtickQuotedString]]] retain];
+ indexResult = [[mySQLConnection queryString:[NSString stringWithFormat:@"NSPrintPanelShowsPageSetupAccessory %@", [selectedTable backtickQuotedString]]] retain];
// [indexes setArray:[[self fetchResultAsArray:indexResult] retain]];
[indexes setArray:[self fetchResultAsArray:indexResult]];
[indexResult release];
@@ -832,6 +832,23 @@ returns a dictionary containing enum/set field names as key and possible values
return [NSDictionary dictionaryWithDictionary:enumFields];
}
+- (NSArray *)tableStructureForPrint
+{
+ CMMCPResult *queryResult;
+ NSMutableArray *tempResult = [NSMutableArray array];
+ int i;
+
+ queryResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW COLUMNS FROM %@", [selectedTable backtickQuotedString]]];
+
+ if ([queryResult numOfRows]) [queryResult dataSeek:0];
+ [tempResult addObject:[queryResult fetchFieldNames]];
+ for ( i = 0 ; i < [queryResult numOfRows] ; i++ ) {
+ [tempResult addObject:[queryResult fetchRowAsArray]];
+ }
+
+ return tempResult;
+}
+
#pragma mark TableView datasource methods
- (int)numberOfRowsInTableView:(NSTableView *)aTableView