aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.h
Commit message (Collapse)AuthorAgeFilesLines
* Tidy up.stuconnolly2009-11-071-2/+0
|
* • improved error highlightingBibiko2009-10-241-3/+4
| | | | | - remember the start position of query/queries and calculate an offset for error highlighting (this fixes issue 442 mostly) - avoid highlighting of empty "near messages"
* - Apply new document task support to the Custom Query tab, and run all ↵rowanbeentje2009-10-231-1/+12
| | | | | | | | custom queries in a background thread with the task interface active. - Rework custom query result processing to allow display of results as they come in - Fix a memory leak
* • improved behavior while closing a document windowBibiko2009-09-041-5/+21
| | | | | | | - if not connected close it without any checks - if an Untitled document contains stored query favorites - What should be done? - up to now it saves them to the global prefs • header in query favorites list keep visible while filtering • code cleaning
* • prepared Query Name Sheet for choosing the target of the to be saved ↵Bibiko2009-09-041-0/+1
| | | | query favorite (global or not)
* • implementation of a new history controllerBibiko2009-09-041-5/+0
| | | | | | | | | | | | | - each history is doc-based even if you have opened not only one instance of the same spf file - for each SPF file identified by its file URL SP remembers each history item regardless from which doc instance it comes from internally ( to make sure that after closing the last instance of a doc all executed queries are saved in that file - if the user wants to change that s/he has to save that file under a different name ) - the history list for each Untitled doc will be initialized by the items stored in the global SP's prefs - the history list for each SPF doc will be initialized by the items stored in the SPF file unless an instance of the same file is already open - then the new instance inherits the history list from the opened one(s) - all history items executed in any Untitled docs will be added to SP's prefs - in other words SP's global prefs plist is the historyrepository for each new Untitled doc - if the user saves an untitled doc or rename an opened SPF file the _current_ history list for that doc will be saved to the chosen file unless an other doc instance is still open - all history lists are saved automatically if SP quits or the user closes a doc window Note: This should be tested for any logical pitfalls - each desired logic can be implemented :)
* • simplified and unified the issue to set the title of a tableWindowBibiko2009-09-021-11/+17
| | | | | | | | | | | | | | - everything will be configured in [TableDocument displayName] - to update the title call [TableDocument setTitle:[TableDocument displayName]] - this removes dozens of lines • first steps to support more the document-based approach ( a document is nothing else than a connection with view properties and preferences ) - renamed/added/changed in Main Menu items into "New", "Open", "Save", and "Save As" - if user opened a spf file -> fileURL will be set - "Save" will save the current connection/view data according to the "Save As" setting - ie if one saved a doc with do not "Remember window state" - "Save" won't save the window state; to enable this hit "Save As" [this works for encrypted file data as well] - if the current doc was opened from file and the user closes it or quits the entire app all connection/document-based preferences (up to now query favs and history) will be updated silently [not yet implemented fully in CustomQuery] [works for encrypted file as well] • delete saveSPFAccessory view from DBView since it was outsourced • fixed some issues for the NSSecureTextField in the Save accessory panel (but still a warning appears)
* • Custom Query:Bibiko2009-08-281-0/+5
| | | | | | | - added to History list "Replace Editor Content" (stored in the prefs) and a search field - "Save ... to Favorites" menu title changes according to selection in the textView Problem: How can we allow if the user hits RETURN in a search field (fav/history) to select the next menu item if any and to change the first responder to popup button menu list?
* • added to "Query Favorite" popup menu:Bibiko2009-08-261-0/+6
| | | | | | - "Replace Editor Content" check box menu item; if checked the chosen query will replace the editor's content if not it will insert it (setting will be saved in the prefs) - Search Text Field to filter the list of names (by using a regular expressions) - added a tooltip to each menu item displaying the query behind the name
* Completely redesigned query favorite manager, including:stuconnolly2009-08-261-16/+9
| | | | | | | | | | | - The ability to name query favorites - The ability to edit query favorites using the same editor in the cutom query view - The ability to save your query favorites to a file Note that any already saved query favorites will be upgraded to accommodate the new format, that is including a name associated with the query. The default name is the first 32 chars of the query with '...' appended. Also, added menu item validation to the 'Save Query to Favorites' menu item.
* Alter CustomQuery to use StreamingResult to download and process result sets:rowanbeentje2009-08-261-1/+1
| | | | | | | - Significantly improve memory usage - Minor speedup (1.1x faster?) to overall query/display times - Improvements to MCPStreamingResult and MCPConnection to accurately report affected row count
* The query favorite manager shouldn't be blocking the main thread. Part of ↵stuconnolly2009-08-231-2/+0
| | | | issue #357.
* • Main Menu > FileBibiko2009-08-201-1/+3
| | | | | | | | - renamed "Open" into "Open…" plus tooltip - added "Save Query…" (enabled if a query is in the editor and rename 'Query' to 'Queries' dynamically) [still hidden] - added "Save Connection…" [still hidden] • added method numberOfQueries to CustomQuery • 'Save Query…" and "Save Connection…" are bound to the same connector distinguished via their tags
* • open a SQL file via Finder or Terminal (open *.sql if SP is the default ↵Bibiko2009-08-051-0/+1
| | | | | | | app for sql files) will insert the file content into the Custom Query editor of the current active doc - this action starts SP and asks for a connection if it is not running - same for drag&drop a SQL file onto SP's dock icon
* • Editing in Custom Query:Bibiko2009-07-261-2/+4
| | | | | - now fields are also identified via the database which the field belongs to in order to allow to select/join/etc. fields coming from different databases and to improve the unambiguity of the field origin - sped up editing check for fields with no table or database origin (then no "select count(*)" is needed)
* - For custom query result columns which map to SQL fields, check the column ↵rowanbeentje2009-07-241-1/+1
| | | | | | | width memory to set column widths - Save custom query result columns back to the master column width store for columns witch map to SQL fields
* Merge framework integration branch back to trunk. Summary of changes:stuconnolly2009-07-211-8/+7
| | | | | | | | | | | | | | | - Includes all custom code from subclasses CMMCPConnection and CMMCPResult, meaning they have subsequently been removed from the project. - All previous Sequel Pro specific code in the above subclasses has been removed in favour of the delegate (currently set to TableDocumet) informing the framework of such information. - All references to CMMCPConnection and CMMCPResult have subsequently been changed to MCPConnection and MCPResult. - Framework includes MySQL 5.1.36 client libraries and source headers. - Framework is now built as a 4-way (32/64 bit, i386/PPC arch) binary. - All import references to <MCPKit_bundled/MCPKit_bundled.h> have been changed to <MCPKit/MCPKit.h>. - New script 'build-mysql-client.sh' can be used to build the MySQL client libraries from the MySQL source. See the script's header for a list of available options or run it with no arguments to display it's usage. Note that there are still a few changes to be made to the framework with regard to removing Sequel Pro specific calls to the delegate. These however can be made later on as they have no effect on functionality and are merely design changes. Also, note that any future development done on the framework should be made to be as 'generic' as possible, with no Sequel Pro specific references. This should allow the framework to be integrated into another project without the need for SP specific code.
* • fixed bug if the table sorting query in Custom Query gave an errorBibiko2009-07-211-1/+2
| | | | | | - SP tried to select the erroneous part in customQueryView which could lead to an range exception - now it shows a proper error message - it suppresses column highlighting and setting of the NSSortIndicator
* • rewrote ⌘/ "comment line" completelyBibiko2009-07-161-2/+4
| | | | | | | | | | | - ⌘/ (un)comment current line only if no selection is given (by using "-- ") -- caret jumps to the next line to (un)comment lines quickly -- # sign will be recognized for uncommenting as well as if the entire line is wrapped into /* */ - ⌘/ (un)comment current selection (by wrapping it into /* */) -- it (un)escapes present */ into *\/ automatically - ⌥⌘/ (un)comment the current query (by wrapping it into /* */) -- the GUI element will be found in the Gear Menu by pressing ⌥ • added shortcut ⌫ to Table Content's "Delete selected row(s)" tooltip
* • Comment current Query/SelectionBibiko2009-07-151-0/+1
| | | | | | | - changed comment string to "-- " - fixed bug in uncomment - added gear menu item -- TODO: change menu item title according to selection/current query (coming soon)
* • initial support for ⌘/ in CustomQuery editor to (un)comment out the ↵Bibiko2009-07-151-0/+1
| | | | | | current query or selection by inserting "# " at the begin of each line - Note: not yet finished completely
* Rework data storage and retrieval in TableContent and CustomQuery backing ↵rowanbeentje2009-07-131-1/+1
| | | | | | | | | | | | arrays, and make some editable CustomQuery improvements: - Switch to using arrays for row storage rather than dictionaries. Use the data column index for table column identifiers. - This fixes Issue #316 and also allows sorting by all custom query result columns using a column index rather than the name - Offers significant speed and memory advantages: result building is now 2x-3x faster, memory used for results storage is 30-40% lower, and result access is slightly faster. (Note full 2x-3x speed results won't be seen - result fetching and mysql binary work isn't included in the timing) - No longer need to fetch the first column of data for tables containing only blob types - Correctly escape strings when editing CustomQuery results - Rewrite NSArrayObjectAtIndex to use the native CFArrayGetValueAtIndex rather than cached selectors - neater code and I think slightly faster
* • initial trial to make Custom Query's result table sortable by clicking ↵Bibiko2009-06-241-0/+2
| | | | at a column header
* • Custom Query fixes:Bibiko2009-06-241-1/+1
| | | | | - preserve table width/order after editing - updated data source code to avoid having the data twice in the memory
* • added to the CustomQuery class the multipleLineEditingButton IBOutletBibiko2009-06-231-0/+1
|
* • fixed: make usage of backtickQuotedString to allow table names ↵Bibiko2009-06-231-0/+1
| | | | | | containing a ` • some minor code cleaning and commenting
* • first trial to make the result table in the Custom Query editable for ↵Bibiko2009-06-221-1/+4
| | | | such fields which can be identified bijectively by the given table data
* • first steps to synchronize CustomQuery table and ContentTableBibiko2009-06-221-0/+4
| | | | | | - CustomQuery table now allows to copy selected rows as SQL INSERT (table name is set to "<table>" - if a field is a blob display only the first 255 bytes/chars in the CQ table for speed reasons - blob fields in CQ does not listen to the pref setting for "LoadBlobsAsNeeded" because it could happen that no one-to-one relation to their original data will be found
* • added to Editor Preferences:Bibiko2009-06-051-0/+1
| | | | | - "Query Background" color - checkbox "Highlight Current Query"
* • fixed: suppress highlighting of the current query if something is selectedBibiko2009-06-041-0/+1
| | | | • added: "Select Active Query ^Y" context menu item to the Custom Query Editor
* • simplified quertAtPosition:Bibiko2009-06-041-1/+1
| | | | | | • added queryRangeAtPosition: method because this is needed also for other purposes • moved the commands for highlighting the current query from queryAtPosition: to textViewDidChangedSelection: (where it belongs to) • some minor changes in error highlighting code
* • added support for the “delimiter” commandBibiko2009-06-041-0/+2
| | | | | | | | | | | | | | - added (NSArray *) splitSqlStringByCharacter:(unichar)character; (NSArray *) splitSqlStringIntoRangesByCharacter:(unichar)character; (long) firstOccurrenceInSqlOfCharacter: to the SQLParser which recognize a “delimiter” command • queryAtPosition now works with ranges to speed it up - the current query ranges resp. the just activated query range are cached in order to avoid parsing if the user only navigates through the textView buffer, or if the user calls Run Prev/Current Query only • the "import dump" function makes usage of that new “delimiter” support - i.e. dumps with procs/funcs declaration could be imported IMPORTANT: Please check the new SQLParser exhaustively in order to prove that new approach
* More header updates for source files, including Subversion Id property.stuconnolly2009-05-191-1/+2
|
* • added "MySQL Help" to the MainMenu > Help submenuBibiko2009-04-301-0/+4
| | | | | | - it shows the MySQL Help TOC of the front most tableDocument mysql connection, i.e. each tableDocument has its own Help window (due to the fact that the Help is version specific), and makes it the keyWindow - changed the way for getting the mySQLversion into the CustomQuery; now a new tableDocument set it via [customQueryInstance setMySQLversion:foo]; the other way was to unsafe regarding to get the version if MySQL Help was invoked via MainMenu • Help window and Create Table Syntax window will be released while closing the tableDocument
* • changed context menu item in CQ's textview to support "MySQL Help"Bibiko2009-04-301-0/+1
| | | | | • prepared code to work with autoHelp • improved getRangeForCurrentWord (fix for " |a")
* • MySQL HelpBibiko2009-04-301-1/+1
| | | | | | - updated autoHelp, now it recognizes cursor movement via mouse • if the chunk in CQ's textview is too large remove all attributes • some minor code cosmetics
* • MySQL HelpBibiko2009-04-301-3/+4
| | | | | - refactored and cleaned contextMenuItems for the webview - help-html-template will be loaded only once
* • MySQL Help refactoringBibiko2009-04-291-3/+5
|
* • MySQL HelpBibiko2009-04-291-7/+7
| | | | | - change help target buttons into a NSSegmentedControl - fixed minor typo
* • MySQL Help improved:Bibiko2009-04-281-1/+2
| | | | | | | - added history: go back/forward - window now has auto save name MYSQL_HELP_WINDOW - disabled contextual menu for safety reasons (temporarily) - some minor stuff
* • MySQL Help improvedBibiko2009-04-271-3/+17
| | | | | | | | | - added help target (online, in current page, in MySQL help ⌥⌘O,P,M) - GUI support for go back/forward (not yet implemented) - ⌘G, ⇧⌘G for find next/prev in current page - ⌘F selects search field; ⌘+ and ⌘- support - online search is version sensitive
* • MySQL Help improvedBibiko2009-04-271-0/+11
| | | | | | - better HTML view, list topics for multi-matching keywords - for test cases invoke it by CTRL+H in the Custom Query textView - GUI is really tentative!
* • added a prototype to support an Help view for the current word in the ↵Bibiko2009-04-241-0/+5
| | | | | | Custom Query text view - work in progress!
* • CHANGED: if an error occurs in a series of queries the user will be ↵Bibiko2009-04-221-0/+4
| | | | | | | | | | | | | | | asked to "Stop", "Continue" or "Run All" - Stop: the execution will stop at the erroneous query (if other queries would follow "Execution stopped!" will be prompted in the error message field) - Continue: continues the execution but shows that alert for a next error - Run All: runs all following queries regardless of possible errors • improved the error selection - fixed the issue for Run Current/Previous (even for duplicates) - if no error line is given it selects the first query which caused an error entirely - due to the localization of mysql error messages changed the regexps for catching the: -- line number to /([0-9]+)$/ because the line number always should be outputted at the end -- "near message" to / '(.*?)' / (important the last space because after that space the line number will be outputted) -- further checks are needed
* - Add support for "Run previous" in the custom query text field; this ↵rowanbeentje2009-04-211-1/+1
| | | | behaviour for the "Run current"/"Run selection" button is triggered if the text caret is only separated by whitespace from the last query, to allow easy running of a just-typed query
* • added selectLineNumber:x to CMTextView to be able to select the line xBibiko2009-04-201-0/+1
| | | | | | | | | • added error highlighting of the first mentioned error - if a "near message" error is provided select that message otherwise select the entire error line and scrolls to it - if no "at line x" and no "near message" is given do nothing - if a selection was given and the user pressed "runAll" destroy the selection before error checking; if no error was found reconstruct that selection (to be able to distinguish between "runSelection" and "runAll" plus selection) * changed slightly the trigger for syntax highlighting/auto-uppercasing for better scrollToRange behaviour
* Added printing support via WebKit WebViewbamse162009-04-111-0/+3
|
* - Fix an invalid reference to a missing pulldown_arrow image causing ↵rowanbeentje2009-04-051-0/+1
| | | | | | | | invalid log entries - Set the focus to the custom query text field when appropriate when switching to the custom query tab - Add the ability to set the custom query editor font, save and load it from preferences, and no longer reset the font on queries
* - Add the ability for CMTextView to automatically capitalise SQL keywords ↵rowanbeentje2009-04-031-0/+1
| | | | in the text view, currently off by default but saved from preferences. Thanks again to Hans-Jörg Bibiko for this patch; see Issue #218.
* - Implemented "Clear History" in new Gear menuavenjamin2009-04-021-0/+1
| | | | - Changed UI in Query Tab for favourite and history popups as well as Run query buttons