aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename CustomQuery as SPCustomQuery.stuconnolly2010-07-061-236/+0
|
* - Make the query info/error display collapsible.stuconnolly2010-07-061-1/+5
| | | | | | | - Add a 'gear menu' with the option to export the current result set as either CSV or XML. (Note, that the collapsiable view currently suffers from the same BWToolKit issue as the table information pane).
* Rename CMTextView to SPTextView.stuconnolly2010-05-271-2/+2
|
* Initial implementation of tabs:rowanbeentje2010-05-231-1/+0
| | | | | | | | - Addition of PSMTabBar framework - Rework away from a document-based TableDocument - Support tabs throughout the application - Add menu items for creating tabs, and add support for dragging tabs to different windows
* General tidy up, with a focus on consolidating more constants in ↵stuconnolly2010-03-241-2/+0
| | | | SPConstants.h/m.
* Rework the running of custom queries, improving thread safety by splitting ↵rowanbeentje2010-03-121-0/+2
| | | | out table drawing and status/error drawing onto their own methods. This should address http://log.sequelpro.com/view/28 , http://log.sequelpro.com/view/45 and http://log.sequelpro.com/view/48
* • added $SP_ASLIST_ALL_FIELDS_FROM_SELECTED_TABLE as pre-defined snippet listBibiko2010-03-091-0/+1
| | | | | • added Show Completion List submenu to the Custom Query Editor gear menu with the items all dbs ^1, all tables ^2, all fields ^3 • if dbStructure is available show these pre-defined completion lists with all info like the completion it does, otherwise fall back to plain style
* - Move history popup construction to the main thread, fixing crashes ↵rowanbeentje2010-03-081-0/+1
| | | | probably caused by non-thread-safe menu interaction. This addresses http://log.sequelpro.com/view/19
* • Query Favorites:Bibiko2010-02-251-0/+1
| | | | | | | | - added snippet variable $SP_SELECTED_TABLES which inserts `table1`,`table2`, etc. (ONLY tables) • improved "Check Table" - now one can select more than one table to execute "CHECK TABLE table1,table2,… ; if all tables passed successfully alert OK, if not show the result as accessory table in the sheet note: OPTIMIZE, REPAIR, FLUSH, CHECKSUM, ANALYZE follow
* - Implement result view saving in a more general way within CustomQuery; ↵rowanbeentje2010-02-111-1/+13
| | | | now when editing custom query results *and* sorting custom query results, scroll position and selection index are preserved
* • fixed synchronisation of history lists if more than one instance of the ↵Bibiko2010-02-051-0/+3
| | | | | | same SPF file is open - simplified code a bit
* • refactored the entire history logic in Custom QueryBibiko2010-02-051-0/+5
| | | | | | - queries which are longer than then 64 chars are truncated in title and queries which are longer than then 256 chars are truncated in tooltip to avoid processing time to load very long queries from history; this also decreases the memory usage - added "Insert Next/Previous History Query" logic bound to ^↑ and ^↓ - fixed tiny GUI spacing problem in Custom Query
* • current query highlighting is done now in drawRect: (much more faster ↵Bibiko2010-01-301-1/+1
| | | | | | | | and thanks to Jakob) • improved snippet background drawings esp. for multiple lines (commit on behalf of Jakob) • simplified code for changing and setting background colors and Pref setting for highlight current query by observers (much more faster)
* Add a new SPDataStorage class, and use it in TableContent and CustomQuery:rowanbeentje2010-01-171-4/+4
| | | | | | | | - SPDataStorage is a class designed for a 2D array of fixed-width data storage, replacing the current method of nested NSMutableArrays. NSFastEnumerator compatible. - Overall memory overhead for table storage in memory reduced by 1.2-1.4x - this almost gains back the large memory jump seen for 64 bit - Some operations (adding data, retrieving a single cell's data) are faster than nested NSMutableArrays; some operations (requesting a row as an NSArray) are slightly slower as the data needs to be converted, but overall result is a slight speed gain. (- Could be used in future to store SQL results in C datatypes, avoiding very high NSObject overhead for numbers and short strings)
* - Upgrade Sequel Pro to be compiled as a 3-way PPC/i386/x86_64 binary for ↵rowanbeentje2010-01-091-3/+3
| | | | | | | release builds, including a large number of 64bit compatibility upgrades and tweaks - Upgrade RegexKitLite to 3.3
* • added Save/Copy History List to "Query History"'s popup menuBibiko2010-01-051-3/+13
| | | | | | | | • moved "Clear History" from gear menu to "Query History"'s popup menu and added a confirmation sheet to it • "Clear History" now distinguishes between Untitled and SPF doc - if Untitled: clear global history list stored in the Prefs - if SPF doc: clear the document-based history list only
* • remember scrollview port and selected row after editing in the Custom ↵Bibiko2010-01-041-0/+3
| | | | | | | | | | Query table view - after reloading the entire data the table view port will be restored but this leads up to now to a "tiny jitter" (maybe fixable in the near future) - the re-selection does NOT follow the actual edited row, e.g. if one changes a cell value whose column is used for sorting the actual edited row could appear somewhere • if the editing in the Custom Query table view was invoked by pressing RETURN/ENTER one can go through the columns by pressing ESC but up to now that editing will be interrupted after the user pressed OK - this behaviour is temporary and should be fixed in the near future by storing the new row data temporarily; after editing the last column AND if all columns have the same table origin the row data will be updated. To allow the row editing for columns which have different table origins could probably cause inconsistencies. - further discussion is needed
* • fixed issue for "Update Help while typing" to suppress opening the MySQL ↵Bibiko2009-12-031-2/+3
| | | | documentation periodically if no internal help can be found
* - When working with the storage arrays for CustomQuery and TableContent, ↵rowanbeentje2009-11-281-0/+2
| | | | use thread locking to ensure data safety while the table is loading. This should fix intermittent loading and reload issues, including part of #463 and should address Issue #482
* 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