You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(5) |
Aug
(24) |
Sep
(21) |
Oct
(2) |
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(5) |
Mar
(6) |
Apr
(8) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(23) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(7) |
Oct
(8) |
Nov
(8) |
Dec
(1) |
2009 |
Jan
(5) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(6) |
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(16) |
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
(3) |
Dec
|
From: Neil T. <nt...@us...> - 2006-08-11 18:05:21
|
Update of /cvsroot/pgsqlformac/QueryTool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30477 Modified Files: ChangeLog SqlDocument.m Log Message: Fix some compiler warnings. Index: SqlDocument.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.m,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** SqlDocument.m 16 Jul 2006 23:17:39 -0000 1.15 --- SqlDocument.m 11 Aug 2006 18:03:09 -0000 1.16 *************** *** 904,908 **** - (BOOL)isValueKeyword:(NSString *)value { ! int x; NSString *trimmedValue = [value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; for (x = 0; x < [keywords count]; x++) --- 904,908 ---- - (BOOL)isValueKeyword:(NSString *)value { ! unsigned int x; NSString *trimmedValue = [value stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; for (x = 0; x < [keywords count]; x++) *************** *** 935,939 **** { // loop through the range, breaking at each delimiter to set the attributes ! long i; i = rangeToColor.location; --- 935,939 ---- { // loop through the range, breaking at each delimiter to set the attributes ! unsigned long i; i = rangeToColor.location; *************** *** 976,980 **** // if the edited range contains no delimiters... ! long i = rangeOfEdit.location; if (i >= [[ts string] length]) { i = [[ts string] length] - 1; } --- 976,980 ---- // if the edited range contains no delimiters... ! unsigned long i = rangeOfEdit.location; if (i >= [[ts string] length]) { i = [[ts string] length] - 1; } Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ChangeLog 16 Jul 2006 23:17:39 -0000 1.9 --- ChangeLog 11 Aug 2006 18:03:09 -0000 1.10 *************** *** 1,2 **** --- 1,16 ---- + 2006-07-16 18:17 ntiffin + + * ChangeLog, MyOutlineView.h, MyOutlineView.m, MyResultsView.h, + MyResultsView.m, SqlDocument.h, SqlDocument.m, TODO.txt, + English.lproj/MainMenu.nib/classes.nib, + English.lproj/MainMenu.nib/info.nib, + English.lproj/MainMenu.nib/objects.nib, + English.lproj/SqlDocument.nib/classes.nib, + English.lproj/SqlDocument.nib/info.nib, + English.lproj/SqlDocument.nib/keyedobjects.nib: Make font changes + work for schema and results views, make index generation use + autoincrementing index names, add help menu to bring up + postgresql html help files. + 2006-06-24 11:20 ntiffin *************** *** 18,21 **** --- 32,40 ---- parsing problem. + 2006-06-20 11:29 ntiffin + + * ChangeLog, SqlDocument.m, TODO.txt: Update for better round trip + function processing. + 2006-06-10 13:43 ntiffin *************** *** 54,64 **** * ChangeLog: Update ChangeLog. - 2006-05-13 14:28 ntiffin - - * English.lproj/: MainMenu~.nib/classes.nib, - MainMenu~.nib/info.nib, MainMenu~.nib/objects.nib, - SqlDocument~.nib/classes.nib, SqlDocument~.nib/info.nib, - SqlDocument~.nib/keyedobjects.nib: Remove backup files from cvs. - 2006-05-13 14:26 ntiffin --- 73,76 ---- *************** *** 126,138 **** English.lproj/MainMenu.nib/info.nib, English.lproj/MainMenu.nib/objects.nib, - English.lproj/MainMenu~.nib/classes.nib, - English.lproj/MainMenu~.nib/info.nib, - English.lproj/MainMenu~.nib/objects.nib, English.lproj/SqlDocument.nib/classes.nib, English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib, ! English.lproj/SqlDocument~.nib/classes.nib, ! English.lproj/SqlDocument~.nib/info.nib, ! English.lproj/SqlDocument~.nib/keyedobjects.nib, Help/.DS_Store, Help/index.html: Initial Import --- 138,144 ---- English.lproj/MainMenu.nib/info.nib, English.lproj/MainMenu.nib/objects.nib, English.lproj/SqlDocument.nib/classes.nib, English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib, Help/.DS_Store, Help/index.html: Initial Import *************** *** 153,165 **** English.lproj/MainMenu.nib/info.nib, English.lproj/MainMenu.nib/objects.nib, - English.lproj/MainMenu~.nib/classes.nib, - English.lproj/MainMenu~.nib/info.nib, - English.lproj/MainMenu~.nib/objects.nib, English.lproj/SqlDocument.nib/classes.nib, English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib, ! English.lproj/SqlDocument~.nib/classes.nib, ! English.lproj/SqlDocument~.nib/info.nib, ! English.lproj/SqlDocument~.nib/keyedobjects.nib, Help/.DS_Store, Help/index.html: Initial revision --- 159,165 ---- English.lproj/MainMenu.nib/info.nib, English.lproj/MainMenu.nib/objects.nib, English.lproj/SqlDocument.nib/classes.nib, English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib, Help/.DS_Store, Help/index.html: Initial revision |
Update of /cvsroot/pgsqlformac/QueryTool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9024 Modified Files: ChangeLog MyOutlineView.h MyOutlineView.m SqlDocument.h SqlDocument.m TODO.txt Added Files: MyResultsView.h MyResultsView.m Log Message: Make font changes work for schema and results views, make index generation use autoincrementing index names, add help menu to bring up postgresql html help files. Index: TODO.txt =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/TODO.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TODO.txt 24 Jun 2006 16:20:39 -0000 1.4 --- TODO.txt 16 Jul 2006 23:17:39 -0000 1.5 *************** *** 13,16 **** --- 13,17 ---- + FIXME (Known Errors) ==================== *************** *** 21,24 **** --- 22,40 ---- Completed ========= + - 2006-07-16 Fix TODO for autoincrementing index names + + - 2006-07-16 Use color to separate tables names and other database structure names from actual meta data. + http://forums.macnn.com/archive/index.php/t-212768.html + + - 2006-07-15 font commands do not work in for results view and log view, need to figure out how NSFontPanel works with tables + + // from http://www.cocoabuilder.com/archive/message/cocoa/2002/1/10/15632 + http://www.codecomments.com/message506689.html + http://www.codecomments.com/archive242-2005-5-506689.html + + - 2006-07-15 Add menu to select postgres docs (file:///sw/share/doc/postgresql81/html/index.html) and to where ever pgCocoa installs them and SQL commands + file:///sw/share/doc/postgresql81/html/sql-commands.html + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http:// ... "]]; + - 2006-06-16 When running VACUUM FULL VERBOSE ANALYZE the resulting text is not displayed in the GUI. (2006-06-24 added SQL Log). Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChangeLog 21 Jun 2006 13:42:01 -0000 1.8 --- ChangeLog 16 Jul 2006 23:17:39 -0000 1.9 *************** *** 1,6 **** ! 2006-06-20 11:29 ntiffin ! * ChangeLog, SqlDocument.m, TODO.txt: Update for better round trip ! function processing. 2006-06-10 13:43 ntiffin --- 1,20 ---- ! 2006-06-24 11:20 ntiffin ! * SqlDocument.h, SqlDocument.m, TODO.txt, ! English.lproj/MainMenu.nib/classes.nib, ! English.lproj/MainMenu.nib/info.nib, ! English.lproj/MainMenu.nib/objects.nib, ! English.lproj/SqlDocument.nib/classes.nib, ! English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib: Add SQL Log ! window. ! ! 2006-06-21 08:42 ntiffin ! ! * ChangeLog, SqlDocument.m, SqlToolbarCategory.m, TODO.txt, ! cancel_script_32.png, English.lproj/SqlDocument.nib/info.nib, ! English.lproj/SqlDocument.nib/keyedobjects.nib: Add ! NSUserDefaults, icon for canceling script, fix multiple statement ! parsing problem. 2006-06-10 13:43 ntiffin --- NEW FILE: MyResultsView.h --- // // MyResultsView.h // Query Tool for PostgresN // // Created by Neil Tiffin on 7/16/06. // Copyright 2006 Performance Champions, Inc. All rights reserved. // #import <Cocoa/Cocoa.h> @interface MyResultsView : NSTableView { NSFont *currentFont; } - (void)changeFont:(id)sender; - (NSFont *)currentFont; - (void)setCurrentFont:(NSFont *)theFont; @end Index: MyOutlineView.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/MyOutlineView.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MyOutlineView.m 2 Jun 2006 17:29:51 -0000 1.5 --- MyOutlineView.m 16 Jul 2006 23:17:39 -0000 1.6 *************** *** 3,7 **** @implementation MyOutlineView ! - (NSMenu *) menuForEvent:(NSEvent *) event { int theRow =[self selectedRow]; if (theRow == -1) --- 3,8 ---- @implementation MyOutlineView ! - (NSMenu *) menuForEvent:(NSEvent *) event ! { int theRow =[self selectedRow]; if (theRow == -1) *************** *** 218,220 **** --- 219,250 ---- menuActionTarget = theSQLDocument; } + + -(void)changeFont:(id)sender + { + int i; + NSFont *oldFont = currentFont; + currentFont = [sender convertFont:oldFont]; + NSArray *theCols = [self tableColumns]; + int colCnt = [self numberOfColumns]; + for(i=0; i< colCnt; i++) + { + [[[theCols objectAtIndex:i] dataCell] setFont:currentFont]; + } + [self setRowHeight:[[[theCols objectAtIndex:0] dataCell] cellSize].height]; + + [[NSUserDefaults standardUserDefaults] setObject:[currentFont fontName] forKey:@"PGSqlForMac_QueryTool_SchemaTableFontName"]; + [[NSUserDefaults standardUserDefaults] setFloat:[currentFont pointSize] forKey:@"PGSqlForMac_QueryTool_SchemaTableFontSize"]; + } + + -(NSFont*)currentFont + { + return currentFont; + } + + -(void)setCurrentFont:(NSFont*)theFont + { + currentFont=theFont; + } + + @end Index: MyOutlineView.h =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/MyOutlineView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MyOutlineView.h 2 Jun 2006 17:29:51 -0000 1.3 --- MyOutlineView.h 16 Jul 2006 23:17:39 -0000 1.4 *************** *** 13,19 **** --- 13,24 ---- id menuActionTarget; + + NSFont *currentFont; } - (void)setMenuActionTarget:(id)theSQLDocument; + - (void)changeFont:(id)sender; + - (NSFont *)currentFont; + - (void)setCurrentFont:(NSFont *)theFont; @end --- NEW FILE: MyResultsView.m --- // // MyResultsView.m // Query Tool for PostgresN // // Created by Neil Tiffin on 7/16/06. // Copyright 2006 __MyCompanyName__. All rights reserved. // #import "MyResultsView.h" @implementation MyResultsView -(void)changeFont:(id)sender { int i; NSFont *oldFont = currentFont; currentFont = [sender convertFont:oldFont]; NSArray *theCols = [self tableColumns]; int colCnt = [self numberOfColumns]; for(i=0; i< colCnt; i++) { [[[theCols objectAtIndex:i] dataCell] setFont:currentFont]; } [self setRowHeight:[[[theCols objectAtIndex:0] dataCell] cellSize].height]; [[NSUserDefaults standardUserDefaults] setObject:[currentFont fontName] forKey:@"PGSqlForMac_QueryTool_ResultsTableFontName"]; [[NSUserDefaults standardUserDefaults] setFloat:[currentFont pointSize] forKey:@"PGSqlForMac_QueryTool_ResultsTableFontSize"]; } -(NSFont*)currentFont { return currentFont; } -(void)setCurrentFont:(NSFont*)theFont { currentFont=theFont; } @end Index: SqlDocument.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.m,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SqlDocument.m 24 Jun 2006 16:20:39 -0000 1.14 --- SqlDocument.m 16 Jul 2006 23:17:39 -0000 1.15 *************** *** 33,36 **** --- 33,68 ---- } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_SchemaTableFontName"] == nil) + { + [userDefaults setObject:@"Lucida Grande" forKey:@"PGSqlForMac_QueryTool_SchemaTableFontName"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_SchemaTableFontSize"] == nil) + { + [userDefaults setFloat:12.0 forKey:@"PGSqlForMac_QueryTool_SchemaTableFontSize"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ResultsTableFontName"] == nil) + { + [userDefaults setObject:@"Lucida Grande" forKey:@"PGSqlForMac_QueryTool_ResultsTableFontName"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ResultsTableFontSize"] == nil) + { + [userDefaults setFloat:12.0 forKey:@"PGSqlForMac_QueryTool_ResultsTableFontSize"]; + } + + NSFileManager *fileManager = [NSFileManager defaultManager]; + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowPostgreSQLHelp"] == nil) + { + if ([fileManager fileExistsAtPath:@"/sw/share/doc/postgresql81/html/index.html"]) + { + [userDefaults setObject:@"file:///sw/share/doc/postgresql81/html/index.html" forKey:@"PGSqlForMac_QueryTool_ShowPostgreSQLHelp"]; + } + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowSQLCommandHelp"] == nil) + { + if ([fileManager fileExistsAtPath:@"/sw/share/doc/postgresql81/html/sql-commands.html"]) + { + [userDefaults setObject:@"file:///sw/share/doc/postgresql81/html/sql-commands.html" forKey:@"PGSqlForMac_QueryTool_ShowSQLCommandHelp"]; + } + } return self; } *************** *** 72,75 **** --- 104,129 ---- [[query textStorage] setDelegate:self]; + NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; + + // set the font for the schema view + font = [NSFont fontWithName:[userDefaults stringForKey:@"PGSqlForMac_QueryTool_SchemaTableFontName"] size:[userDefaults floatForKey:@"PGSqlForMac_QueryTool_SchemaTableFontSize"]]; + [schemaView setCurrentFont:font]; + NSEnumerator* columns = [[schemaView tableColumns] objectEnumerator]; + NSTableColumn* column; + while (column = [columns nextObject]) + { + [[column dataCell] setFont: font]; + } + [schemaView setRowHeight: [font defaultLineHeightForFont] + 2]; + + //set the font for the results view + font = [NSFont fontWithName:[userDefaults stringForKey:@"PGSqlForMac_QueryTool_ResultsTableFontName"] size:[userDefaults floatForKey:@"PGSqlForMac_QueryTool_ResultsTableFontSize"]]; + [dataOutput setCurrentFont:font]; + columns = [[dataOutput tableColumns] objectEnumerator]; + while (column = [columns nextObject]) + { + [[column dataCell] setFont: font]; + } + [dataOutput setRowHeight: [font defaultLineHeightForFont] + 2]; // init the keyword arrays *************** *** 252,255 **** --- 306,361 ---- } + - (IBAction)onShowPostgreSQLHTML:(id) sender + { + NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowPostgreSQLHelp"]]]; + } + + + - (IBAction)onShowSQLHTML:(id) sender + { + NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; + [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowSQLCommandHelp"]]]; + } + + + -(IBAction) setSchemaViewFont:(id) sender + { + NSFontPanel *myFontPanel =[NSFontPanel sharedFontPanel]; + + [window makeFirstResponder:schemaView]; + + [myFontPanel setDelegate:self]; + [myFontPanel setPanelFont: [schemaView currentFont] isMultiple:NO]; + [myFontPanel setEnabled:YES]; + [myFontPanel makeKeyAndOrderFront:self]; + } + + -(IBAction) setDataOutputViewFont:(id) sender + { + NSFontPanel *myFontPanel =[NSFontPanel sharedFontPanel]; + + [window makeFirstResponder:dataOutput]; + + [myFontPanel setDelegate:self]; + [myFontPanel setPanelFont: [dataOutput font] isMultiple:NO]; + [myFontPanel setEnabled:YES]; + [myFontPanel makeKeyAndOrderFront:self]; + } + + -(IBAction) setSQLLogViewFont:(id) sender + { + NSFontPanel *myFontPanel =[NSFontPanel sharedFontPanel]; + [sqlLogPanelTextView setUsesFontPanel:YES]; + + [window makeFirstResponder:sqlLogPanelTextView]; + + [myFontPanel setDelegate:self]; + [myFontPanel setPanelFont: [sqlLogPanelTextView font] isMultiple:NO]; + [myFontPanel setEnabled:YES]; + [myFontPanel makeKeyAndOrderFront:self]; + } + + - (IBAction)onConnectCancel:(id)sender { *************** *** 587,594 **** NSAssert(schemaName, @"onSelectCreateIndexOnColsMenuItem: no schema name."); bool first = true; - //TODO make number auto determined NSMutableString *sql = [[[NSMutableString alloc] init] autorelease]; ! [sql appendFormat:@"CREATE INDEX %@_idx1 ON %@.%@ (", tableName, schemaName, tableName]; while (currentIndex != NSNotFound) { if (!first) --- 693,700 ---- NSAssert(schemaName, @"onSelectCreateIndexOnColsMenuItem: no schema name."); bool first = true; + int indexCount = [[explorer schema] getIndexCountFromSchema:schemaName fromTableName:tableName] + 1; NSMutableString *sql = [[[NSMutableString alloc] init] autorelease]; ! [sql appendFormat:@"CREATE UNIQUE INDEX %@_idx%d ON %@.%@ (", tableName, indexCount, schemaName, tableName]; while (currentIndex != NSNotFound) { if (!first) *************** *** 613,620 **** NSAssert(schemaName, @"onSelectCreateUniqIndexOnColsMenuItem: no schema name."); bool first = true; - //TODO make number auto determined NSMutableString *sql = [[[NSMutableString alloc] init] autorelease]; ! [sql appendFormat:@"CREATE UNIQUE INDEX %@_idx1 ON %@.%@ (", tableName, schemaName, tableName]; while (currentIndex != NSNotFound) { if (!first) --- 719,726 ---- NSAssert(schemaName, @"onSelectCreateUniqIndexOnColsMenuItem: no schema name."); bool first = true; + int indexCount = [[explorer schema] getIndexCountFromSchema:schemaName fromTableName:tableName] + 1; NSMutableString *sql = [[[NSMutableString alloc] init] autorelease]; ! [sql appendFormat:@"CREATE UNIQUE INDEX %@_idx%d ON %@.%@ (", tableName, indexCount, schemaName, tableName]; while (currentIndex != NSNotFound) { if (!first) *************** *** 853,857 **** - (void)textViewDidChangeSelection:(NSNotification *)aNotification { ! // based upon the current locatiodn, scan forward and backward to the nearest // delimiter and highlight the current word based upon that delimiter NSTextStorage *ts = [query textStorage]; --- 959,963 ---- - (void)textViewDidChangeSelection:(NSNotification *)aNotification { ! // based upon the current location, scan forward and backward to the nearest // delimiter and highlight the current word based upon that delimiter NSTextStorage *ts = [query textStorage]; Index: SqlDocument.h =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SqlDocument.h 24 Jun 2006 16:20:39 -0000 1.10 --- SqlDocument.h 16 Jul 2006 23:17:39 -0000 1.11 *************** *** 13,16 **** --- 13,17 ---- #import "ExplorerModel.h" #import "MyOutlineView.h" + #import "MyResultsView.h" @interface SqlDocument : NSDocument *************** *** 20,24 **** IBOutlet NSTextView *query; IBOutlet NSTextView *rawOutput; ! IBOutlet NSTableView *dataOutput; IBOutlet NSTabView *tabs; IBOutlet NSProgressIndicator *working; --- 21,25 ---- IBOutlet NSTextView *query; IBOutlet NSTextView *rawOutput; ! IBOutlet MyResultsView *dataOutput; IBOutlet NSTabView *tabs; IBOutlet NSProgressIndicator *working; *************** *** 73,76 **** --- 74,84 ---- - (IBAction)onSetDatabase:(id)sender; - (IBAction)onShowSQLLog:(id)sender; + - (IBAction)onShowPostgreSQLHTML:(id)sender; + - (IBAction)onShowSQLHTML:(id)sender; + + // set view fonts + - (IBAction)setSchemaViewFont:(id)sender; + - (IBAction)setDataOutputViewFont:(id)sender; + - (IBAction)setSQLLogViewFont:(id)sender; // Respond to dynamic menus in the object browser. |
From: Neil T. <nt...@us...> - 2006-07-16 23:17:42
|
Update of /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9024/English.lproj/SqlDocument.nib Modified Files: classes.nib info.nib keyedobjects.nib Log Message: Make font changes work for schema and results views, make index generation use autoincrementing index names, add help menu to bring up postgresql html help files. Index: info.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/info.nib,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** info.nib 24 Jun 2006 16:20:39 -0000 1.8 --- info.nib 16 Jul 2006 23:17:40 -0000 1.9 *************** *** 4,8 **** <dict> <key>IBDocumentLocation</key> ! <string>31 46 847 438 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> --- 4,8 ---- <dict> <key>IBDocumentLocation</key> ! <string>11 79 873 292 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> *************** *** 16,25 **** <key>IBOpenObjects</key> <array> - <integer>43</integer> - <integer>119</integer> <integer>5</integer> </array> <key>IBSystem Version</key> ! <string>8I127</string> </dict> </plist> --- 16,23 ---- <key>IBOpenObjects</key> <array> <integer>5</integer> </array> <key>IBSystem Version</key> ! <string>8J135</string> </dict> </plist> Index: classes.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/classes.nib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** classes.nib 24 Jun 2006 16:20:39 -0000 1.6 --- classes.nib 16 Jul 2006 23:17:40 -0000 1.7 *************** *** 5,8 **** --- 5,14 ---- {CLASS = MyOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, { + ACTIONS = {changeFont = id; }; + CLASS = MyResultsView; + LANGUAGE = ObjC; + SUPERCLASS = NSTableView; + }, + { ACTIONS = { onConnect = id; Index: keyedobjects.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/keyedobjects.nib,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvsm0Re0t and /tmp/cvsu09DPj differ |
From: Neil T. <nt...@us...> - 2006-07-16 23:17:42
|
Update of /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9024/English.lproj/MainMenu.nib Modified Files: classes.nib info.nib objects.nib Log Message: Make font changes work for schema and results views, make index generation use autoincrementing index names, add help menu to bring up postgresql html help files. Index: info.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/info.nib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** info.nib 24 Jun 2006 16:20:39 -0000 1.3 --- info.nib 16 Jul 2006 23:17:40 -0000 1.4 *************** *** 4,12 **** <dict> <key>IBDocumentLocation</key> ! <string>152 14 635 412 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>29</key> ! <string>86 558 431 44 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> --- 4,12 ---- <dict> <key>IBDocumentLocation</key> ! <string>102 69 635 412 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>29</key> ! <string>86 558 477 44 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> *************** *** 17,21 **** </array> <key>IBSystem Version</key> ! <string>8I127</string> </dict> </plist> --- 17,21 ---- </array> <key>IBSystem Version</key> ! <string>8J135</string> </dict> </plist> Index: objects.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/objects.nib,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsenpvRj and /tmp/cvslkTUp9 differ Index: classes.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/classes.nib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** classes.nib 24 Jun 2006 16:20:39 -0000 1.2 --- classes.nib 16 Jul 2006 23:17:40 -0000 1.3 *************** *** 3,11 **** { ACTIONS = { - myAction = id; onConnect = id; onDisconnect = id; onExecuteQuery = id; onShowSQLLog = id; }; CLASS = FirstResponder; --- 3,17 ---- { ACTIONS = { onConnect = id; onDisconnect = id; onExecuteQuery = id; + onShowPostgreSQLHTML = id; + onShowSQLHTML = id; onShowSQLLog = id; + setDataOutputViewFont = id; + setQueryViewFont = id; + setSQLLogViewFont = id; + setSchemaViewFont = id; + show = id; }; CLASS = FirstResponder; |
Update of /cvsroot/pgsqlformac/pgCocoaDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7546 Modified Files: ChangeLog Connection.h Connection.m ExplorerModel.m ExplorerNode.h ExplorerNode.m Schema.h Schema.m Log Message: Add color to Explorer View, add index count function. Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ChangeLog 21 Jun 2006 11:47:09 -0000 1.11 --- ChangeLog 16 Jul 2006 23:13:06 -0000 1.12 *************** *** 1,2 **** --- 1,11 ---- + 2006-06-24 11:16 ntiffin + + * Connection.h, Connection.m, ExplorerModel.m, Schema.m: Add SQL + log functions, correct bug in schema dealloc. + + 2006-06-21 06:47 ntiffin + + * ChangeLog: Test commits mail list. + 2006-06-20 11:26 ntiffin Index: Schema.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Schema.m,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Schema.m 24 Jun 2006 16:16:33 -0000 1.15 --- Schema.m 16 Jul 2006 23:13:06 -0000 1.16 *************** *** 22,26 **** Field * versionField; ! self = [super init]; connection = theConnection; [connection retain]; --- 22,26 ---- Field * versionField; ! [super init]; connection = theConnection; [connection retain]; *************** *** 134,137 **** --- 134,149 ---- } + -(int)getIndexCountFromSchema:(NSString *)schemaName fromTableName:(NSString *) tableName; + { + NSString *sql; + + sql = [NSString stringWithFormat:@"SELECT count(*) FROM pg_catalog.pg_indexes WHERE schemaname = '%@' AND tablename = '%@'", schemaName, tableName]; + #if PGCOCOA_LOG_SQL + NSLog(sql); + #endif + RecordSet * results = [connection execQueryNoLog:sql]; + + return [[[[[results itemAtIndex: 0] fields] itemAtIndex:0] value] intValue]; + } -(RecordSet *)getIndexNamesFromSchema:(NSString *)schemaName fromTableName:(NSString *) tableName; *************** *** 139,143 **** NSString *sql; ! sql = [NSMutableString stringWithFormat:@"%s'%@'%s'%@'%s","SELECT indexname \ FROM pg_catalog.pg_indexes WHERE schemaname = ", schemaName, " AND tablename = ", tableName, " ORDER BY indexname ASC"]; //return [self getNamesFromSchema:schemaName fromType: @"i"]; --- 151,155 ---- NSString *sql; ! sql = [NSString stringWithFormat:@"%s'%@'%s'%@'%s","SELECT indexname \ FROM pg_catalog.pg_indexes WHERE schemaname = ", schemaName, " AND tablename = ", tableName, " ORDER BY indexname ASC"]; //return [self getNamesFromSchema:schemaName fromType: @"i"]; *************** *** 152,156 **** { NSString * sql; ! sql = [NSMutableString stringWithString:@"SELECT schema_name FROM information_schema.schemata ORDER BY schema_name"]; #if PGCOCOA_LOG_SQL NSLog(sql); --- 164,168 ---- { NSString * sql; ! sql = [NSString stringWithString:@"SELECT schema_name FROM information_schema.schemata ORDER BY schema_name"]; #if PGCOCOA_LOG_SQL NSLog(sql); Index: Schema.h =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Schema.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Schema.h 2 Jun 2006 11:48:17 -0000 1.9 --- Schema.h 16 Jul 2006 23:13:06 -0000 1.10 *************** *** 63,68 **** -(NSString *)getViewCommentFromSchema:(NSString *)schemaName fromViewName:(NSString *)viewName; ! // get server info -(RecordSet *)getLocks; @end --- 63,69 ---- -(NSString *)getViewCommentFromSchema:(NSString *)schemaName fromViewName:(NSString *)viewName; ! // get server info or misc -(RecordSet *)getLocks; + -(int)getIndexCountFromSchema:(NSString *)schemaName fromTableName:(NSString *) tableName; @end Index: Connection.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Connection.m,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Connection.m 24 Jun 2006 16:16:33 -0000 1.10 --- Connection.m 16 Jul 2006 23:13:06 -0000 1.11 *************** *** 330,333 **** --- 330,343 ---- - (RecordSet *)execQuery:(NSString *)sql { + #if PG_COCOA_DEBUG == 1 + return [self execQuery:sql logInfo:0 logSQL:0]; + #else + return [self execQuery:sql logInfo:0 logSQL:0]; + #endif + } + + + - (RecordSet *)execQueryLog:(NSString *)sql + { return [self execQuery:sql logInfo:1 logSQL:0]; } Index: Connection.h =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Connection.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Connection.h 24 Jun 2006 16:16:33 -0000 1.5 --- Connection.h 16 Jul 2006 23:13:06 -0000 1.6 *************** *** 71,74 **** --- 71,75 ---- - (RecordSet *)execQuery:(NSString *)sql; - (RecordSet *)execQueryNoLog:(NSString *)sql; + - (RecordSet *)execQueryLog:(NSString *)sql; - (RecordSet *)execQuery:(NSString *)sql logInfo:(bool)logInfo logSQL:(bool)logSQL; - (NSString *)execCommand:(NSString *)sql; Index: ExplorerNode.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerNode.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ExplorerNode.m 13 May 2006 18:04:00 -0000 1.3 --- ExplorerNode.m 16 Jul 2006 23:13:06 -0000 1.4 *************** *** 52,55 **** --- 52,60 ---- -(NSString *) name { + return [name string]; + } + + -(NSAttributedString *) attributedName + { return name; } *************** *** 91,100 **** -(void)setName:(NSString *)s { - [s retain]; [name release]; ! name = s; } ! -(void)setBaseTable:(NSString *)s; { [s retain]; --- 96,110 ---- -(void)setName:(NSString *)s { [name release]; ! name = [[NSAttributedString alloc] initWithString:s]; ! [name retain]; } ! -(void)setNameColor:(NSColor *)s ! { ! ; //TODO ! } ! ! -(void)setBaseTable:(NSString *)s { [s retain]; *************** *** 103,107 **** } ! -(void)setExplorerType:(NSString *)s; { [s retain]; --- 113,117 ---- } ! -(void)setExplorerType:(NSString *)s { [s retain]; Index: ExplorerModel.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerModel.m,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExplorerModel.m 24 Jun 2006 16:16:33 -0000 1.6 --- ExplorerModel.m 16 Jul 2006 23:13:06 -0000 1.7 *************** *** 473,477 **** // What is returned depends upon which column it is going to appear. if ([identifier isEqual:@"col1"]) ! return [item name]; if ([identifier isEqual:@"col2"]) return [item displayColumn2]; --- 473,488 ---- // What is returned depends upon which column it is going to appear. if ([identifier isEqual:@"col1"]) ! { ! if ([[item explorerType] isEqualToString:@"Schema Child"] ) ! { ! NSDictionary *attributes = [[NSDictionary alloc] initWithObjectsAndKeys:[NSColor blueColor], NSForegroundColorAttributeName, nil]; ! NSAttributedString *myString = [[NSAttributedString alloc] initWithString:[item name] attributes: attributes]; ! return myString; ! } ! else ! { ! return [item name]; ! } ! } if ([identifier isEqual:@"col2"]) return [item displayColumn2]; Index: ExplorerNode.h =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerNode.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExplorerNode.h 13 May 2006 18:04:00 -0000 1.2 --- ExplorerNode.h 16 Jul 2006 23:13:06 -0000 1.3 *************** *** 12,16 **** NSMutableArray * children; ExplorerNode * parent; ! NSString * name; // name of this node displayed in column 1 // of the outline view NSString * baseTable; // pg_catalog table where the oid resides --- 12,16 ---- NSMutableArray * children; ExplorerNode * parent; ! NSAttributedString * name; // name of this node displayed in column 1 // of the outline view NSString * baseTable; // pg_catalog table where the oid resides *************** *** 26,29 **** --- 26,30 ---- // Accessor methods -(NSString *)name; + //-(NSAttributedString *) attributedName; -(NSString *)baseTable; -(NSString *)explorerType; *************** *** 34,37 **** --- 35,39 ---- -(void)setName:(NSString *)s; + -(void)setNameColor:(NSColor *)s; -(void)setBaseTable:(NSString *)s; -(void)setExplorerType:(NSString *)s; |
From: Neil T. <nt...@us...> - 2006-07-16 23:13:09
|
Update of /cvsroot/pgsqlformac/pgCocoaDB/UnitTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7546/UnitTest Modified Files: pgCocoaDBSchemaTest.m Log Message: Add color to Explorer View, add index count function. Index: pgCocoaDBSchemaTest.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/UnitTest/pgCocoaDBSchemaTest.m,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pgCocoaDBSchemaTest.m 20 Jun 2006 16:26:52 -0000 1.11 --- pgCocoaDBSchemaTest.m 16 Jul 2006 23:13:06 -0000 1.12 *************** *** 69,76 **** STAssertTrue([conn errorDescription] == nil, @"Not able to '%@', %@.", sql, [conn errorDescription]); if (0 == [results count]) { // test database does not exist - sql = [NSString stringWithFormat:@"%s%@", "CREATE DATABASE ", PGCocoaTestDatabase]; NSLog(sql); [conn execQuery:sql]; --- 69,76 ---- STAssertTrue([conn errorDescription] == nil, @"Not able to '%@', %@.", sql, [conn errorDescription]); + sql = [NSString stringWithFormat:@"CREATE DATABASE %@ WITH ENCODING = 'UTF8' TABLESPACE = pg_default;", PGCocoaTestDatabase]; if (0 == [results count]) { // test database does not exist NSLog(sql); [conn execQuery:sql]; *************** *** 83,92 **** // add -DDROP_EXISTING_DATABASE=1 to the OTHER_CFLAGS in project builder // or you can uncomment the #define in the configuration area of this file. ! sql = [NSString stringWithFormat:@"%s%@", "DROP DATABASE ", PGCocoaTestDatabase]; ! NSLog(sql); ! [conn execQuery:sql]; STAssertTrue([conn errorDescription] == nil, @"Not able to '%@', %@.", sql, [conn errorDescription]); - sql = [NSString stringWithFormat:@"%s%@", "CREATE DATABASE ", PGCocoaTestDatabase]; NSLog(sql); [conn execQuery:sql]; --- 83,91 ---- // add -DDROP_EXISTING_DATABASE=1 to the OTHER_CFLAGS in project builder // or you can uncomment the #define in the configuration area of this file. ! NSString *sql1 = [NSString stringWithFormat:@"%s%@", "DROP DATABASE ", PGCocoaTestDatabase]; ! NSLog(sql1); ! [conn execQuery:sql1]; STAssertTrue([conn errorDescription] == nil, @"Not able to '%@', %@.", sql, [conn errorDescription]); NSLog(sql); [conn execQuery:sql]; |
From: Neil T. <nt...@us...> - 2006-06-24 16:20:42
|
Update of /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3759/English.lproj/SqlDocument.nib Modified Files: classes.nib info.nib keyedobjects.nib Log Message: Add SQL Log window. Index: info.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/info.nib,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** info.nib 21 Jun 2006 13:42:02 -0000 1.7 --- info.nib 24 Jun 2006 16:20:39 -0000 1.8 *************** *** 4,8 **** <dict> <key>IBDocumentLocation</key> ! <string>23 13 847 438 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> --- 4,8 ---- <dict> <key>IBDocumentLocation</key> ! <string>31 46 847 438 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> *************** *** 17,20 **** --- 17,21 ---- <array> <integer>43</integer> + <integer>119</integer> <integer>5</integer> </array> Index: classes.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/classes.nib,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** classes.nib 2 Jun 2006 17:29:51 -0000 1.5 --- classes.nib 24 Jun 2006 16:20:39 -0000 1.6 *************** *** 11,21 **** --- 11,29 ---- onDisconnect = id; onExecuteQuery = id; + onSelectAlterAddColMenuItem = id; + onSelectAlterRenameColMenuItem = id; onSelectAlterTableRenameMenuItem = id; + onSelectColSelectMenuItem = id; + onSelectColsMenuItem = id; onSelectCreateBakTableMenuItem = id; onSelectCreateFunctionMenuItem = id; onSelectCreateFunctionTemplateMenuItem = id; + onSelectCreateIndexOnColsMenuItem = id; + onSelectCreateTabColsMenuItem = id; onSelectCreateTableMenuItem = id; + onSelectCreateUniqIndexOnColsMenuItem = id; onSelectCreateViewMenuItem = id; onSelectCreateViewTemplateMenuItem = id; + onSelectDropColMenuItem = id; onSelectDropFunctionMenuItem = id; onSelectDropTableMenuItem = id; *************** *** 41,44 **** --- 49,54 ---- rawOutput = NSTextView; schemaView = MyOutlineView; + sqlLogPanel = NSPanel; + sqlLogPanelTextView = NSTextView; status = NSTextField; tabs = NSTabView; Index: keyedobjects.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/keyedobjects.nib,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsb0ni4l and /tmp/cvsRfOJDC differ |
From: Neil T. <nt...@us...> - 2006-06-24 16:20:42
|
Update of /cvsroot/pgsqlformac/QueryTool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3759 Modified Files: SqlDocument.h SqlDocument.m TODO.txt Log Message: Add SQL Log window. Index: SqlDocument.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.m,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SqlDocument.m 21 Jun 2006 13:42:01 -0000 1.13 --- SqlDocument.m 24 Jun 2006 16:20:39 -0000 1.14 *************** *** 15,18 **** --- 15,36 ---- self = [super init]; + NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowInformationSchema"] == nil) + { + [userDefaults setObject:@"yes" forKey:@"PGSqlForMac_QueryTool_ShowInformationSchema"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowPGCatalogSchema"] == nil) + { + [userDefaults setObject:@"yes" forKey:@"PGSqlForMac_QueryTool_ShowPGCatalogSchema"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowPGToastSchema"] == nil) + { + [userDefaults setObject:@"no" forKey:@"PGSqlForMac_QueryTool_ShowPGToastSchema"]; + } + if ([userDefaults stringForKey:@"PGSqlForMac_QueryTool_ShowPGTempsSchema"] == nil) + { + [userDefaults setObject:@"no" forKey:@"PGSqlForMac_QueryTool_ShowPGTempsSchema"]; + } + return self; } *************** *** 79,82 **** --- 97,101 ---- [query setSelectedRange:NSMakeRange(0,0)]; [self performSelector:@selector(onConnect:) withObject:self afterDelay:0.0]; + } *************** *** 112,115 **** --- 131,141 ---- } //[explorer printLog]; + + // set explorer display defaults from NSUserDefaults + NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; + [explorer setShowInformationSchema:[userDefaults boolForKey:@"PGSqlForMac_QueryTool_ShowInformationSchema"]]; + [explorer setShowPGCatalog:[userDefaults boolForKey:@"PGSqlForMac_QueryTool_ShowPGCatalogSchema"]]; + [explorer setShowPGToast:[userDefaults boolForKey:@"PGSqlForMac_QueryTool_ShowPGToastSchema"]]; + [explorer setShowPGTemps:[userDefaults boolForKey:@"PGSqlForMac_QueryTool_ShowPGTempsSchema"]]; } *************** *** 121,125 **** [status setStringValue:[NSString stringWithString:@"Waiting for connection information"]]; ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultHost"]; if (aDefault) { --- 147,151 ---- [status setStringValue:[NSString stringWithString:@"Waiting for connection information"]]; ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_QueryTool_DefaultHost"]; if (aDefault) { *************** *** 130,144 **** [host setStringValue:@"localhost"]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultUserName"]; if (aDefault) { [userName setStringValue:aDefault]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultDatabaseName"]; if (aDefault) { [databaseName setStringValue:aDefault]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultPort"]; if (aDefault) { --- 156,170 ---- [host setStringValue:@"localhost"]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_QueryTool_DefaultUserName"]; if (aDefault) { [userName setStringValue:aDefault]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_QueryTool_DefaultDatabaseName"]; if (aDefault) { [databaseName setStringValue:aDefault]; } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_QueryTool_DefaultPort"]; if (aDefault) { *************** *** 171,185 **** [conn setPassword:[password stringValue]]; [conn setDbName:[databaseName stringValue]]; ! [conn setHost:[host stringValue]]; [conn setPort:[port stringValue]]; ! // update user defaults ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[userName stringValue]] forKey:@"PGSqlForMac_DefaultUserName"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[conn host]] forKey:@"PGSqlForMac_DefaultHost"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[port stringValue]] forKey:@"PGSqlForMac_DefaultPort"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[databaseName stringValue]] forKey:@"PGSqlForMac_DefaultDatabaseName"]; [[NSUserDefaults standardUserDefaults] synchronize]; ! // close the sheet [NSApp stopModal]; --- 197,211 ---- [conn setPassword:[password stringValue]]; [conn setDbName:[databaseName stringValue]]; ! [conn setHost:[host stringValue]]; [conn setPort:[port stringValue]]; ! // update user defaults ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[userName stringValue]] forKey:@"PGSqlForMac_QueryTool_DefaultUserName"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[host stringValue]] forKey:@"PGSqlForMac_QueryTool_DefaultHost"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[port stringValue]] forKey:@"PGSqlForMac_QueryTool_DefaultPort"]; ! [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[databaseName stringValue]] forKey:@"PGSqlForMac_QueryTool_DefaultDatabaseName"]; [[NSUserDefaults standardUserDefaults] synchronize]; ! // close the sheet [NSApp stopModal]; *************** *** 189,194 **** // perform the connection - [conn connect]; if (![conn isConnected]) { --- 215,221 ---- // perform the connection [conn connect]; + + // if the requested database is not found then try "template1" if (![conn isConnected]) { *************** *** 215,221 **** } else { ! [status setStringValue:@"Connection failed: %@"]; ! // [status setStringValue:[NSString stringWithFormat:@"Connected to %@ as %@", ! // [conn host], [conn userName]]]; } } --- 242,252 ---- } else { ! [status setStringValue:@"Connection failed:"]; ! } ! if ([conn sqlLog] != nil) ! { ! //[[[textView textStorage] mutableString] appendString: string]; ! NSRange myRange = NSMakeRange([[sqlLogPanelTextView textStorage] length], 0); ! [[sqlLogPanelTextView textStorage] replaceCharactersInRange:myRange withString:[conn sqlLog]]; } } *************** *** 280,284 **** */ ! NSArray *arrQuery = [toBeRun componentsSeparatedByString:@";"]; int x; --- 311,315 ---- */ ! //NSArray *arrQuery = [toBeRun componentsSeparatedByString:@";"]; int x; *************** *** 289,292 **** --- 320,329 ---- //RecordSet *rs = [conn execQuery:sql]; RecordSet *rs = [conn execQuery:toBeRun]; + if ([conn sqlLog] != nil) + { + //[[[textView textStorage] mutableString] appendString: string]; + NSRange myRange = NSMakeRange([[sqlLogPanelTextView textStorage] length], 0); + [[sqlLogPanelTextView textStorage] replaceCharactersInRange:myRange withString:[conn sqlLog]]; + } if (rs == nil) *************** *** 361,376 **** - (IBAction)onSetDatabase:(id)sender { if ([conn isConnected]) { [conn disconnect]; - [schemaView setDataSource:nil]; - [explorer release]; - explorer = nil; } if ([[[dbList selectedItem] title] length] == 0) { [conn setDbName:@""]; ! } else { [conn setDbName:[[dbList selectedItem] title]]; } --- 398,414 ---- - (IBAction)onSetDatabase:(id)sender { + //NSLog(@"Enter onSetDatabase"); if ([conn isConnected]) { [conn disconnect]; } + //NSLog(@"Disconnect Complete"); if ([[[dbList selectedItem] title] length] == 0) { [conn setDbName:@""]; ! } ! else ! { [conn setDbName:[[dbList selectedItem] title]]; } *************** *** 382,390 **** // create the schema explorer [self setNewExplorerConn]; ! } else { [status setStringValue:@"Connection failed."]; } } - (void)onSelectSelectTableMenuItem:(id)sender { --- 420,448 ---- // create the schema explorer [self setNewExplorerConn]; ! } ! else ! { [status setStringValue:@"Connection failed."]; } + if ([conn sqlLog] != nil) + { + //[[[textView textStorage] mutableString] appendString: string]; + NSRange myRange = NSMakeRange([[sqlLogPanelTextView textStorage] length], 0); + [[sqlLogPanelTextView textStorage] replaceCharactersInRange:myRange withString:[conn sqlLog]]; + } } + + - (IBAction)onShowSQLLog:(id)sender + { + if ([sqlLogPanel isVisible] != 0) + { + [sqlLogPanel center]; + } + [sqlLogPanel makeKeyAndOrderFront: nil]; + [sqlLogPanel setFloatingPanel:0]; + } + + - (void)onSelectSelectTableMenuItem:(id)sender { Index: TODO.txt =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/TODO.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TODO.txt 21 Jun 2006 13:42:01 -0000 1.3 --- TODO.txt 24 Jun 2006 16:20:39 -0000 1.4 *************** *** 2,6 **** - TODO - Features, Functions and Warnings (in priority order) ======================================= --- 2,5 ---- *************** *** 9,27 **** - 2006-06-02 Trigger SQL not complete. ! - 2006-05-27 Query tool connect box does not receive focus when first opened. ! ! - 2006-06-16 When running VACUUM FULL VERBOSE ANALYZE the resulting text is not displayed in the GUI. ! ! - 2006-06-16 Created function to attempt to cancel a query in pgCocoaDB. Need to add button to GUI, create icon, and change to async queries. FIXME (Known Errors) ==================== ! Completed ========= - 2006-06-02 Function create or replace does not fully re-create the function. (2006-06-21) --- 8,39 ---- - 2006-06-02 Trigger SQL not complete. ! - 2006-06-16 Use new function to attempt to cancel a query in pgCocoaDB. Need to change to async queries. + - 2006-06-24 Add command to clear SQL Log. FIXME (Known Errors) ==================== ! 2006-06-22 13:20:17.480 Query Tool for Postgres[5590] -[NSBigMutableString characterAtIndex:] called with out-of-bounds index. For apps linked on Tiger this will raise an exception. For earlier apps it will produce this one-time warning and continue with existing behavior (which is undefined). ! 2006-06-22 13:20:17.480 Query Tool for Postgres[5590] Exception raised during posting of notification. Ignored. exception: *** -[NSBigMutableString characterAtIndex:]: Range or index out of bounds Completed ========= + - 2006-06-16 When running VACUUM FULL VERBOSE ANALYZE the resulting text is not displayed in the GUI. (2006-06-24 added SQL Log). + + - 2006-06-22 17:27:23.418 Query Tool for Postgres[5640] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x3103, name = 'com.druware.postgres.QueryTool.ServiceProvider' + See /usr/include/servers/bootstrap_defs.h for the error codes. + 2006-06-22 17:27:23.422 Query Tool for Postgres[5640] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (com.druware.postgres.QueryTool.ServiceProvider) + (not sure what caused this, is not occuring any longer.) + + - 2006-05-27 Query tool connect box does not receive focus when first opened. (2006-06-22) Appears to be fixed since connect box is filled in with the results from the last connection. + + - 2006-06-22 Added call back notification for server warnings and messages. Not working yet. + + - 2006-06-21 Created temporary icon for cancel script. Needs to be replaced with better one. + + - 2006-06-21 Created function to cancel query. + - 2006-06-02 Function create or replace does not fully re-create the function. (2006-06-21) Index: SqlDocument.h =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SqlDocument.h 2 Jun 2006 17:29:51 -0000 1.9 --- SqlDocument.h 24 Jun 2006 16:20:39 -0000 1.10 *************** *** 38,41 **** --- 38,45 ---- IBOutlet NSPopUpButton *dbList; + // SQL Log Panel + IBOutlet NSPanel *sqlLogPanel; + IBOutlet NSTextView *sqlLogPanelTextView; + // outline schema view IBOutlet MyOutlineView *schemaView; // ref to the schema outline view object *************** *** 68,71 **** --- 72,76 ---- - (IBAction)onDisconnect:(id)sender; - (IBAction)onSetDatabase:(id)sender; + - (IBAction)onShowSQLLog:(id)sender; // Respond to dynamic menus in the object browser. |
From: Neil T. <nt...@us...> - 2006-06-24 16:20:42
|
Update of /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3759/English.lproj/MainMenu.nib Modified Files: classes.nib info.nib objects.nib Log Message: Add SQL Log window. Index: info.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/info.nib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** info.nib 12 Dec 2005 00:22:05 -0000 1.2 --- info.nib 24 Jun 2006 16:20:39 -0000 1.3 *************** *** 4,15 **** <dict> <key>IBDocumentLocation</key> ! <string>127 42 356 240 0 0 1680 1028 </string> <key>IBEditorPositions</key> <dict> <key>29</key> ! <string>108 502 431 44 0 0 1680 1028 </string> </dict> <key>IBFramework Version</key> ! <string>443.0</string> <key>IBOpenObjects</key> <array> --- 4,15 ---- <dict> <key>IBDocumentLocation</key> ! <string>152 14 635 412 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>29</key> ! <string>86 558 431 44 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> ! <string>446.1</string> <key>IBOpenObjects</key> <array> *************** *** 17,21 **** </array> <key>IBSystem Version</key> ! <string>8F46</string> </dict> </plist> --- 17,21 ---- </array> <key>IBSystem Version</key> ! <string>8I127</string> </dict> </plist> Index: objects.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/objects.nib,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsjNnSbb and /tmp/cvsuDpSor differ Index: classes.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/MainMenu.nib/classes.nib,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** classes.nib 8 Mar 2005 21:50:09 -0000 1.1.1.1 --- classes.nib 24 Jun 2006 16:20:39 -0000 1.2 *************** *** 2,6 **** IBClasses = ( { ! ACTIONS = {onConnect = id; onDisconnect = id; onExecuteQuery = id; }; CLASS = FirstResponder; LANGUAGE = ObjC; --- 2,12 ---- IBClasses = ( { ! ACTIONS = { ! myAction = id; ! onConnect = id; ! onDisconnect = id; ! onExecuteQuery = id; ! onShowSQLLog = id; ! }; CLASS = FirstResponder; LANGUAGE = ObjC; |
From: Neil T. <nt...@us...> - 2006-06-24 16:16:37
|
Update of /cvsroot/pgsqlformac/pgCocoaDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1931 Modified Files: Connection.h Connection.m ExplorerModel.m Schema.m Log Message: Add SQL log functions, correct bug in schema dealloc. Index: Schema.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Schema.m,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Schema.m 20 Jun 2006 16:26:51 -0000 1.14 --- Schema.m 24 Jun 2006 16:16:33 -0000 1.15 *************** *** 30,34 **** sql = [NSString stringWithFormat:@"%s", "Select version()"]; ! results = [connection execQuery:sql]; versionField = [[[results itemAtIndex:0] fields] itemAtIndex:0]; pgVersionFound = [[NSString alloc] initWithString: [versionField value]]; --- 30,34 ---- sql = [NSString stringWithFormat:@"%s", "Select version()"]; ! results = [connection execQueryNoLog:sql]; versionField = [[[results itemAtIndex:0] fields] itemAtIndex:0]; pgVersionFound = [[NSString alloc] initWithString: [versionField value]]; *************** *** 67,71 **** - (void)dealloc { - [connection disconnect]; [connection release]; connection = nil; --- 67,70 ---- *************** *** 106,110 **** #endif ! return [connection execQuery:sql]; } --- 105,109 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 118,122 **** #endif ! return [connection execQuery:sql]; } --- 117,121 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 132,136 **** #endif ! return [connection execQuery:sql]; } --- 131,135 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 147,151 **** #endif ! return [connection execQuery:sql]; } --- 146,150 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 158,162 **** #endif ! return [connection execQuery:sql]; } --- 157,161 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 179,183 **** NSLog(sql); #endif ! return [connection execQuery:sql]; } --- 178,182 ---- NSLog(sql); #endif ! return [connection execQueryNoLog:sql]; } *************** *** 238,242 **** NSLog(sql); #endif ! return [connection execQuery:sql]; } --- 237,241 ---- NSLog(sql); #endif ! return [connection execQueryNoLog:sql]; } *************** *** 271,275 **** NSLog(sql); #endif ! return [connection execQuery:sql]; } --- 270,274 ---- NSLog(sql); #endif ! return [connection execQueryNoLog:sql]; } *************** *** 288,292 **** #endif ! return [connection execQuery:sql]; } --- 287,291 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 310,314 **** #endif ! return [connection execQuery:sql]; } --- 309,313 ---- #endif ! return [connection execQueryNoLog:sql]; } *************** *** 356,360 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] != 1) --- 355,359 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] != 1) *************** *** 449,453 **** } sql = [NSString stringWithFormat:@"SELECT pg_catalog.format_type('%s'::pg_catalog.oid, NULL)", allargtypes[i]]; ! results1 = [connection execQuery:sql]; if ([results1 count] != 1) { --- 448,452 ---- } sql = [NSString stringWithFormat:@"SELECT pg_catalog.format_type('%s'::pg_catalog.oid, NULL)", allargtypes[i]]; ! results1 = [connection execQueryNoLog:sql]; if ([results1 count] != 1) { *************** *** 478,482 **** #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 477,481 ---- #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 501,505 **** #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 500,504 ---- #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 591,595 **** #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 590,594 ---- #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 615,619 **** #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 614,618 ---- #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 663,667 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 662,666 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 683,687 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 682,686 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 702,706 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 701,705 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 723,727 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 722,726 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 742,746 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 741,745 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 761,765 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 760,764 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 780,784 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 779,783 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 799,803 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 798,802 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 820,824 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 819,823 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 839,843 **** NSLog(sql); #endif ! results = [connection execQuery:sql]; if ([results count] == 1) { --- 838,842 ---- NSLog(sql); #endif ! results = [connection execQueryNoLog:sql]; if ([results count] == 1) { *************** *** 871,875 **** #endif ! return [connection execQuery:sql]; } --- 870,874 ---- #endif ! return [connection execQueryNoLog:sql]; } Index: Connection.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Connection.m,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Connection.m 17 Jun 2006 23:03:33 -0000 1.9 --- Connection.m 24 Jun 2006 16:16:33 -0000 1.10 *************** *** 9,12 **** --- 9,23 ---- #import "Connection.h" #include "libpq-fe.h" + #import <sys/time.h> + + // When a pqlib notice is raised this function gets called + void + handle_pq_notice(void *arg, const char *message) + { + Connection *theConn = (Connection *) arg; + //NSLog(@"%s", message); + [theConn appendSQLLog:[NSString stringWithFormat: @"%s\n", message]]; + } + @implementation Connection *************** *** 29,32 **** --- 40,44 ---- errorDescription = [[[[NSString alloc] init] retain] autorelease]; + sqlLog = [[NSMutableString alloc] init]; return self; *************** *** 56,61 **** errorDescription = [[NSString alloc] initWithFormat:@"%s", PQerrorMessage(pgconn)]; [[errorDescription retain] autorelease]; PQfinish(pgconn); - connected = NO; return NO; --- 68,74 ---- errorDescription = [[NSString alloc] initWithFormat:@"%s", PQerrorMessage(pgconn)]; [[errorDescription retain] autorelease]; + [self appendSQLLog:[NSMutableString stringWithFormat:@"Connection to database %@ Failed.\n", dbName]]; + PQfinish(pgconn); connected = NO; return NO; *************** *** 65,68 **** --- 78,86 ---- [errorDescription release]; errorDescription = nil; + + // set up notification + PQsetNoticeProcessor(pgconn, handle_pq_notice, self); + + [self setSQLLog:[NSMutableString stringWithFormat:@"Connected to database %@.\n", dbName]]; connected = YES; return YES; *************** *** 94,101 **** } PQfinish(pgconn); - connected = NO; - return YES; } --- 112,118 ---- } + [self appendSQLLog:[NSMutableString stringWithString:@"Disconnected from database.\n"]]; PQfinish(pgconn); connected = NO; return YES; } *************** *** 261,264 **** --- 278,282 ---- } + - (NSString *)currentDatabase { *************** *** 280,292 **** } - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - (RecordSet *)execQuery:(NSString *)sql { PGresult* res; if (pgconn == nil) { - [errorDescription release]; errorDescription = [[NSString alloc] initWithString:@"Object is not Connected."]; [[errorDescription retain] autorelease]; --- 298,355 ---- } + - (NSMutableString *)sqlLog; + { + return [[sqlLog retain] autorelease]; + } + + + - (void)setSQLLog:(NSString *)value + { + [sqlLog release]; + sqlLog = [NSMutableString stringWithString:value]; + [sqlLog retain]; + } + + - (void)appendSQLLog:(NSString *)value + { + if (sqlLog == nil) + { + sqlLog = [NSMutableString stringWithString:value]; + [sqlLog retain]; + } + else + { + [sqlLog appendString:value]; + } + } + + + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - (RecordSet *)execQuery:(NSString *)sql { + return [self execQuery:sql logInfo:1 logSQL:0]; + } + + + - (RecordSet *)execQueryNoLog:(NSString *)sql + { + return [self execQuery:sql logInfo:0 logSQL:0]; + } + + + - (RecordSet *)execQuery:(NSString *)sql logInfo:(bool)logInfo logSQL:(bool)logSQL + { + struct timeval start, finished; + double elapsed_time; + long seconds, usecs; PGresult* res; + [errorDescription release]; + errorDescription = nil; + if (pgconn == nil) { errorDescription = [[NSString alloc] initWithString:@"Object is not Connected."]; [[errorDescription retain] autorelease]; *************** *** 294,299 **** return nil; } ! res = PQexec(pgconn, [sql cString]); switch (PQresultStatus(res)) { --- 357,375 ---- return nil; } ! gettimeofday(&start, 0); res = PQexec(pgconn, [sql cString]); + if (logInfo) + { + gettimeofday(&finished, 0); + seconds = finished.tv_sec - start.tv_sec; + usecs = finished.tv_usec - start.tv_usec; + if (usecs < 0) + { + seconds--; + usecs = usecs + 1000000; + } + elapsed_time = (double) seconds *1000.0 + (double) usecs *0.001; + [self appendSQLLog: [NSString stringWithFormat: @"Completed in %d milliseconds.\n", (long) elapsed_time]]; + } switch (PQresultStatus(res)) { *************** *** 320,324 **** } } ! return rs; break; --- 396,404 ---- } } ! if (logInfo) ! { ! [self appendSQLLog:[NSString stringWithFormat: @"%d rows affected.\n", nRecords]]; ! } ! PQclear(res); return rs; break; *************** *** 327,331 **** case PGRES_COMMAND_OK: { ! errorDescription = nil; return nil; break; --- 407,419 ---- case PGRES_COMMAND_OK: { ! if (strlen(PQcmdStatus(res))) ! { ! [self appendSQLLog:[NSString stringWithFormat:@"%s\n", PQcmdStatus(res)]]; ! } ! if ((strlen(PQcmdTuples(res)) > 0) && (logInfo)) ! { ! [self appendSQLLog:[NSString stringWithFormat: @"%s rows affected.\n", PQcmdTuples(res)]]; ! } ! PQclear(res); return nil; break; *************** *** 334,346 **** case PGRES_EMPTY_QUERY: { ! errorDescription = nil; return nil; break; } ! default: { - [errorDescription release]; errorDescription = [[NSString alloc] initWithFormat:@"PostgreSQL Error: %s", PQresultErrorMessage(res)]; --- 422,441 ---- case PGRES_EMPTY_QUERY: { ! if (logInfo) ! { ! [self appendSQLLog:@"Postgres reported Empty Query\n"]; ! } ! PQclear(res); return nil; break; } ! case PGRES_COPY_OUT: ! case PGRES_COPY_IN: ! case PGRES_BAD_RESPONSE: ! case PGRES_NONFATAL_ERROR: ! case PGRES_FATAL_ERROR: default: { errorDescription = [[NSString alloc] initWithFormat:@"PostgreSQL Error: %s", PQresultErrorMessage(res)]; *************** *** 356,359 **** --- 451,455 ---- { PGresult* res; + NSString *results; if (pgconn == nil) *************** *** 375,381 **** return nil; } ! ! return [[[[NSString alloc] initWithCString:PQcmdTuples(res)] retain] autorelease]; ! //return 0; } --- 471,481 ---- return nil; } ! if (strlen(PQcmdStatus(res))) ! { ! [self appendSQLLog:[[NSString alloc] initWithFormat:@"%s\n", PQcmdStatus(res)]]; ! } ! results = [[[[NSString alloc] initWithCString:PQcmdTuples(res)] retain] autorelease]; ! PQclear(res); ! return results; } Index: ExplorerModel.m =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ExplorerModel.m,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ExplorerModel.m 2 Jun 2006 11:48:17 -0000 1.5 --- ExplorerModel.m 24 Jun 2006 16:16:33 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- #import "RecordSet.h" + @implementation ExplorerModel *************** *** 58,90 **** [newNode release]; - } - } - - - - (void)createViewNodes:(ExplorerNode *)aParent fromSchemaName:(NSString *)schemaName - { - RecordSet * results; - ExplorerNode * newNode; - NSString * viewName; - int i; - - results = [schema getViewNamesFromSchema:schemaName]; - for (i = 0; i < [results count]; i++) - { - newNode = [[ExplorerNode alloc] init]; - viewName = [[[[results itemAtIndex: i] fields] itemAtIndex:0] value]; - [newNode setName:viewName]; - [newNode setBaseTable:viewName]; - [newNode setBaseSchema:schemaName]; - [newNode setExplorerType:@"View Name"]; - [newNode setParent:aParent]; - [newNode setDisplayColumn2:@""]; - // do columns - [self createColumnNodes:newNode fromSchemaName:schemaName fromTableName:viewName]; - - // TODO get indexes and other ?? - [aParent addChild:newNode]; - - [newNode release]; } } --- 59,62 ---- *************** *** 133,137 **** [newNode setBaseSchema:schemaName]; [titleNode addChild:newNode]; ! [newNode release]; } --- 105,109 ---- [newNode setBaseSchema:schemaName]; [titleNode addChild:newNode]; ! [newNode release]; } *************** *** 141,144 **** --- 113,145 ---- + - (void)createViewNodes:(ExplorerNode *)aParent fromSchemaName:(NSString *)schemaName + { + RecordSet * results; + ExplorerNode * newNode; + NSString * viewName; + int i; + + results = [schema getViewNamesFromSchema:schemaName]; + for (i = 0; i < [results count]; i++) + { + newNode = [[ExplorerNode alloc] init]; + viewName = [[[[results itemAtIndex: i] fields] itemAtIndex:0] value]; + [newNode setName:viewName]; + [newNode setBaseTable:viewName]; + [newNode setBaseSchema:schemaName]; + [newNode setExplorerType:@"View Name"]; + [newNode setParent:aParent]; + [newNode setDisplayColumn2:@""]; + // do columns + [self createColumnNodes:newNode fromSchemaName:schemaName fromTableName:viewName]; + + // TODO get indexes and other ?? + [aParent addChild:newNode]; + + [newNode release]; + } + } + + - (void)createTriggerNodes:(ExplorerNode *)aParent fromSchemaName:(NSString *)schemaName fromTableName:(NSString *)tableName { Index: Connection.h =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/Connection.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Connection.h 17 Jun 2006 23:03:33 -0000 1.4 --- Connection.h 24 Jun 2006 16:16:33 -0000 1.5 *************** *** 27,30 **** --- 27,31 ---- NSString *errorDescription; + NSMutableString *sqlLog; void *pgconn; *************** *** 64,68 **** --- 65,75 ---- - (NSString *)errorDescription; + - (NSMutableString *)sqlLog; + - (void)setSQLLog:(NSString *)value; + - (void)appendSQLLog:(NSString *)value; + - (RecordSet *)execQuery:(NSString *)sql; + - (RecordSet *)execQueryNoLog:(NSString *)sql; + - (RecordSet *)execQuery:(NSString *)sql logInfo:(bool)logInfo logSQL:(bool)logSQL; - (NSString *)execCommand:(NSString *)sql; |
From: Neil T. <nt...@us...> - 2006-06-21 13:42:10
|
Update of /cvsroot/pgsqlformac/QueryTool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21547 Modified Files: ChangeLog SqlDocument.m SqlToolbarCategory.m TODO.txt Added Files: cancel_script_32.png Log Message: Add NSUserDefaults, icon for canceling script, fix multiple statement parsing problem. Index: SqlDocument.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlDocument.m,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SqlDocument.m 20 Jun 2006 16:29:00 -0000 1.12 --- SqlDocument.m 21 Jun 2006 13:42:01 -0000 1.13 *************** *** 117,126 **** { /* read the preferences and add them to the drop downs */ [status setStringValue:[NSString stringWithString:@"Waiting for connection information"]]; ! [host setStringValue:@"localhost"]; ! [port setStringValue:@"5432"]; ! [NSApp beginSheet:panelConnect modalForWindow:window --- 117,153 ---- { /* read the preferences and add them to the drop downs */ + NSString * aDefault; [status setStringValue:[NSString stringWithString:@"Waiting for connection information"]]; ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultHost"]; ! if (aDefault) ! { ! [host setStringValue:aDefault]; ! } ! else ! { ! [host setStringValue:@"localhost"]; ! } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultUserName"]; ! if (aDefault) ! { ! [userName setStringValue:aDefault]; ! } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultDatabaseName"]; ! if (aDefault) ! { ! [databaseName setStringValue:aDefault]; ! } ! aDefault = [[NSUserDefaults standardUserDefaults] stringForKey:@"PGSqlForMac_DefaultPort"]; ! if (aDefault) ! { ! [port setStringValue:aDefault]; ! } ! else ! { ! [port setStringValue:@"5432"]; ! } ! [NSApp beginSheet:panelConnect modalForWindow:window *************** *** 148,151 **** --- 175,185 ---- [conn setPort:[port stringValue]]; + // update user defaults + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[userName stringValue]] forKey:@"PGSqlForMac_DefaultUserName"]; + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[conn host]] forKey:@"PGSqlForMac_DefaultHost"]; + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[port stringValue]] forKey:@"PGSqlForMac_DefaultPort"]; + [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithString:[databaseName stringValue]] forKey:@"PGSqlForMac_DefaultDatabaseName"]; + [[NSUserDefaults standardUserDefaults] synchronize]; + // close the sheet [NSApp stopModal]; *************** *** 210,215 **** } ! // this should be implemented as a thread ! // further, it should also parse the command for multiple statements. - (IBAction)onExecuteQuery:(id)sender --- 244,249 ---- } ! // TODO this should be implemented as a thread ! // further, it should also parse the command for multiple statements (or should it? NT) - (IBAction)onExecuteQuery:(id)sender *************** *** 248,252 **** NSArray *arrQuery = [toBeRun componentsSeparatedByString:@";"]; ! int x = 0; //for (x = 0; x < [arrQuery count]; x++) for (x = 0; x < 1; x++) --- 282,286 ---- NSArray *arrQuery = [toBeRun componentsSeparatedByString:@";"]; ! int x; //for (x = 0; x < [arrQuery count]; x++) for (x = 0; x < 1; x++) Index: TODO.txt =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/TODO.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TODO.txt 20 Jun 2006 16:29:00 -0000 1.2 --- TODO.txt 21 Jun 2006 13:42:01 -0000 1.3 *************** *** 7,14 **** - 2006-06-02 Column SQL not complete. - - 2006-06-02 Function create or replace does not fully re-create the function. - - - 2006-06-02 First column of schema view default width is too small. - - 2006-06-02 Trigger SQL not complete. --- 7,10 ---- *************** *** 19,23 **** - 2006-06-16 Created function to attempt to cancel a query in pgCocoaDB. Need to add button to GUI, create icon, and change to async queries. - - 2006-06-20 Does not save last connection parameters for reuse when re-launched. --- 15,18 ---- *************** *** 25,34 **** ==================== - - 2006-06-20 separating sql statements by ";" does not correctly handle $$ quoted text required by functions. - Completed ========= - 2006-06-02 View menu did not have separator before drop menu item. --- 20,35 ---- ==================== Completed ========= + - 2006-06-02 Function create or replace does not fully re-create the function. (2006-06-21) + + - 2006-06-20 Does not save last connection parameters for reuse when re-launched. Added NSUserDefaults to connection pane. (2006-06-21) + + - 2006-06-20 separating sql statements by ";" does not correctly handle $$ quoted text required by functions. Fixed by removeing the parse of entered data. (2006-06-21) + + - 2006-06-02 First column of schema view default width is too small. (2006-06-20) + - 2006-06-02 View menu did not have separator before drop menu item. --- NEW FILE: cancel_script_32.png --- (This appears to be a binary file; contents omitted.) Index: SqlToolbarCategory.m =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/SqlToolbarCategory.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlToolbarCategory.m 12 Dec 2005 00:22:02 -0000 1.2 --- SqlToolbarCategory.m 21 Jun 2006 13:42:01 -0000 1.3 *************** *** 50,53 **** --- 50,61 ---- } + if ( [itemIdentifier isEqualToString:@"Cancel"] ) { + [item setLabel:@"Cancel"]; + [item setPaletteLabel:[item label]]; + [item setImage:[NSImage imageNamed:@"cancel_script_32"]]; + [item setTarget:self]; + [item setAction:@selector(onCancelQuery:)]; + } + if ( [itemIdentifier isEqualToString:@"SelectDB"] ) { NSRect fRect = [dbListView frame]; *************** *** 65,69 **** { return [NSArray arrayWithObjects:@"Connect", @"Disconnect", @"Execute", ! @"SelectDB", NSToolbarSpaceItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, --- 73,77 ---- { return [NSArray arrayWithObjects:@"Connect", @"Disconnect", @"Execute", ! @"Cancel", @"SelectDB", NSToolbarSpaceItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, *************** *** 74,78 **** { return [NSArray arrayWithObjects: ! @"Connect", @"Disconnect", @"Execute", @"SelectDB", NSToolbarFlexibleSpaceItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, nil]; --- 82,86 ---- { return [NSArray arrayWithObjects: ! @"Connect", @"Disconnect", @"Execute", @"Cancel", @"SelectDB", NSToolbarFlexibleSpaceItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, nil]; *************** *** 97,100 **** --- 105,113 ---- } + if ( [theItem action] == @selector(onCancelQuery:) ) + { + return ([conn isConnected]); //FIXME should only be on if executing a query + } + //if ( [[theItem itemIdentifier] isEqualToString:@"SelectDB"] ) //{ Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ChangeLog 20 Jun 2006 16:29:00 -0000 1.7 --- ChangeLog 21 Jun 2006 13:42:01 -0000 1.8 *************** *** 1,2 **** --- 1,7 ---- + 2006-06-20 11:29 ntiffin + + * ChangeLog, SqlDocument.m, TODO.txt: Update for better round trip + function processing. + 2006-06-10 13:43 ntiffin |
From: Neil T. <nt...@us...> - 2006-06-21 13:42:09
|
Update of /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21547/English.lproj/SqlDocument.nib Modified Files: info.nib keyedobjects.nib Log Message: Add NSUserDefaults, icon for canceling script, fix multiple statement parsing problem. Index: info.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/info.nib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** info.nib 2 Jun 2006 17:29:51 -0000 1.6 --- info.nib 21 Jun 2006 13:42:02 -0000 1.7 *************** *** 4,8 **** <dict> <key>IBDocumentLocation</key> ! <string>28 151 847 438 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> --- 4,8 ---- <dict> <key>IBDocumentLocation</key> ! <string>23 13 847 438 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> Index: keyedobjects.nib =================================================================== RCS file: /cvsroot/pgsqlformac/QueryTool/English.lproj/SqlDocument.nib/keyedobjects.nib,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsPYt6CB and /tmp/cvsgxpYzQ differ |
From: Neil T. <nt...@us...> - 2006-06-21 11:47:13
|
Update of /cvsroot/pgsqlformac/pgCocoaDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32345 Modified Files: ChangeLog Log Message: Test commits mail list. Index: ChangeLog =================================================================== RCS file: /cvsroot/pgsqlformac/pgCocoaDB/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ChangeLog 20 Jun 2006 16:26:51 -0000 1.10 --- ChangeLog 21 Jun 2006 11:47:09 -0000 1.11 *************** *** 1,2 **** --- 1,7 ---- + 2006-06-20 11:26 ntiffin + + * ChangeLog, Schema.m, UnitTest/pgCocoaDBSchemaTest.m: Update for + better round trip function processing. + 2006-06-17 18:03 ntiffin |