aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
Commit message (Collapse)AuthorAgeFilesLines
* - don't add an empty query to historyBibiko2009-07-291-8/+9
| | | | | - suppress "error highlighting" for an empty query - this also fixes the issue for inserting an history/favorite item after executing an empty query (due to an exception it wasn't possible) - removed several test NSLogs
* • fixed and improved several issues for sorting the Custom Query result table:Bibiko2009-07-281-8/+59
| | | | | | - better ORDER BY detection - (try to) insert ORDER BY clause at the correct position (e.g. "SELECT * FROM A LIMIT 10 - ORDER clause has to be inserted before LIMIT) - preserve the sort order after editing a field
* • Editing in Custom Query:Bibiko2009-07-261-27/+45
| | | | | - 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-2/+59
| | | | | | | 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
* - Fix editing of results including decimalsrowanbeentje2009-07-231-5/+3
| | | | | - Enable custom query result editing
* Merge framework integration branch back to trunk. Summary of changes:stuconnolly2009-07-211-5/+10
| | | | | | | | | | | | | | | - 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 for table sorter in Custom Query:Bibiko2009-07-211-0/+3
| | | | - remove all comments before changing/adding the ORDER clause (it can happen that the original ORDER clause was commented out and the table sorter wouldn't work)
* • fixed bug if the table sorting query in Custom Query gave an errorBibiko2009-07-211-11/+18
| | | | | | - 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
* Add the ability to navigate between tables via foreign key relationships, ↵rowanbeentje2009-07-181-1/+2
| | | | | | | | | addressing the first part of #209: - For the first column linked by each foreign key, display a link arrow within the table cell - When clicking on the link arrow, select the reference table and set the table filters to select the clicked value - Also uses the table cell subclass to allow the entire cell to be editable, not just the contained text (addresses #250)
* • finial preparation to make Custom Query's result table editableBibiko2009-07-171-17/+36
| | | | | | | - added editing of blob data - (editing not yet enabled) TODO: progress bar while checking if field is editable and writing large blob data
* • changed in Custom Query:Bibiko2009-07-171-79/+45
| | | | | - make usage of SPFieldEditor for displaying result data field (incl. blob data) - set to non-editable yet
* • fixed minor issues for "Comment Line/Selection" in Custom QueryBibiko2009-07-161-6/+11
| | | | - esp. for (un)commenting a selection if it ends with a \n
* • fixed: Custom Query's gear menu item "Comment Line" will change its ↵Bibiko2009-07-161-0/+3
| | | | title to "Comment Selection" if a selection is given
* • rewrote ⌘/ "comment line" completelyBibiko2009-07-161-26/+102
| | | | | | | | | | | - ⌘/ (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-4/+16
| | | | | | | - 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/+30
| | | | | | current query or selection by inserting "# " at the begin of each line - Note: not yet finished completely
* - changed history and favorite selection to insert rather then overwrite ↵mtvee2009-07-141-12/+3
| | | | query editor buffer
* Rework data storage and retrieval in TableContent and CustomQuery backing ↵rowanbeentje2009-07-131-30/+32
| | | | | | | | | | | | 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
* Improve custom query timing and display:rowanbeentje2009-06-271-5/+5
| | | | | | | - Amend timing using clock() to timing based on mach_absolute_time() (see revision comment on Google code) - Ensure the time returned is for the requested query and not subsequent helper queries - Use NSNumberFormatter to return a localised "< 0.1 ms" rather than the hardcoded Euro-style "< 0,1 ms"
* • fixed issue for sorting the Custom Query table via clicking at the ↵Bibiko2009-06-261-2/+4
| | | | header if no ORDER BY statement was found in the original statement
* • initial trial to make Custom Query's result table sortable by clicking ↵Bibiko2009-06-241-11/+56
| | | | at a column header
* • Custom Query fixes:Bibiko2009-06-241-60/+68
| | | | | - preserve table width/order after editing - updated data source code to avoid having the data twice in the memory
* • added to SPDataAdditions:Bibiko2009-06-231-41/+11
| | | | | | - (NSString *) shortStringRepresentationUsingEncoding: --mainly used for displaying large blob data in a tableView • tiny speed improvements for tableView:objectValueForTableColumn and tableView:setObjectValueForTableColumn in Content Browser and Custom Query
* • added SPDataCellFormatter to data cells of the Custom Query tableBibiko2009-06-231-0/+2
| | | | | | | | • in Content Browser send only the first 255 bytes to the cell formatter (makes it a tick faster) • fixed for editing in Content Browser if row contains binary blob data: - use = instead of LIKE operator in UPDATE statement - binary data will converted into X'...' representation
* • fixed: make usage of backtickQuotedString to allow table names ↵Bibiko2009-06-231-52/+72
| | | | | | containing a ` • some minor code cleaning and commenting
* - Improve r911 (initial Custom Query editability) to allow editing of rows ↵rowanbeentje2009-06-221-13/+13
| | | | containing NULL values and editing data in tables with names containing backticks
* • first trial to make the result table in the Custom Query editable for ↵Bibiko2009-06-221-44/+221
| | | | such fields which can be identified bijectively by the given table data
* • improved: "Copy as SQL INSERT" in Custom Query passes the original table ↵Bibiko2009-06-221-6/+23
| | | | name (not that one defined via "AS") if the result columns' table source is the same, otherwise <table>.
* • first steps to synchronize CustomQuery table and ContentTableBibiko2009-06-221-4/+73
| | | | | | - 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
* • some code cleaning and tiny performance enhancements for various ↵Bibiko2009-06-211-23/+30
| | | | for/while loops
* • added to SPArrayAdditions.h: NSArrayObjectAtIndex() inline functionBibiko2009-06-181-9/+12
| | | | | | | | | - id o = NSArrayObjectAtIndex(anArray, index) :== id o = [anArray objectAtIndex:index] - this speed up it ~3µs per call - replaced that inline function for such calls within loops to speed up them • used IMP function pointers for keepAlive calls within queryString: • set -O3 (Fastest) compiler option • allow in preference pane "Tables" to set the Limit up to 50000
* • some tiny improvements to speed up queryString:Bibiko2009-06-181-4/+4
| | | | | | | | | - cache the function pointer for delegate willPerformQuery: - if Console Log window is NOT visible suppress reloadData and scrolling to last line (this speeds it up remarkably); if user opens the Console log window it will be synchronized - timeIntervall for execution time will be divide by CLOCKS_PER_SEC in [NSString stringForTimeInterval] - removed for utf8 enc in cString the return UTF8String (no significant difference) • now execution time shows only the time for mysql_real_query
* • changed regex of trigger a reload of table/db according to executed queriesBibiko2009-06-171-3/+4
| | | | | - now it also recognizes such keywords with leading comments - still further improvements are needed
* • improved: sped up removing the background color for query highlightingBibiko2009-06-061-2/+8
| | | | • added: DELIMITER to the completion suggestions
* • added to Editor Preferences:Bibiko2009-06-051-4/+19
| | | | | - "Query Background" color - checkbox "Highlight Current Query"
* • reload table list, database pull-down menu according to user's ↵Bibiko2009-06-051-13/+37
| | | | | | | | | statements in the Custom Query editor if necessary - if statement begins with: use, create, alter, rename, drop • reload table list, database pull-down menu according to imported statements • sped up "Import MySQL Dump" • fixed some tiny issues of the last commit
* Fixed some memory leaks found using llvm/clang. There are still some to fixbamse162009-06-051-1/+3
|
* • fixed: suppress highlighting of the current query if something is selectedBibiko2009-06-041-1/+7
| | | | • added: "Select Active Query ^Y" context menu item to the Custom Query Editor
* • simplified quertAtPosition:Bibiko2009-06-041-213/+99
| | | | | | • 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
* • updated queryTextRangeForQuery: method to make usage of the new SQLParserBibiko2009-06-041-15/+11
|
* • added support for the “delimiter” commandBibiko2009-06-041-87/+119
| | | | | | | | | | | | | | - 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
* • ADDED: highlight the current active query by setting its background ↵Bibiko2009-05-281-1/+19
| | | | color in the Custom Query Editor
* • fixed dependence in showHelpForCurrentWord: to allow to invoke the help ↵Bibiko2009-05-281-1/+1
| | | | (Context Menu or ^H) from any CMTextView (e.g. from create syntax view in Table Info as well)
* Fix for query editor font being lost. Initialize the prefs reference in ↵stuconnolly2009-05-271-2/+2
| | | | setConnection as opposed to init, so we definitely know the font has already been set. Turns out it was me that moved it to init, my bad.
* • activate Preference setting for caret colorBibiko2009-05-241-1/+2
| | | | | | | | • added prototype for new completion (ESC -> Cocoa, F5 -> new completion) - not yet finished - TODO: -- support for NSSpellChecker items -- images for different types of suggestions like proc/func/tabkle/view/sql statement, db name, etc.
* - Forgot to save this file before last commitavenjamin2009-05-221-3/+3
|
* - Few Changes to Query Editor Preferenceavenjamin2009-05-221-119/+119
| | | | | - Cleaned up a few preference keys - Added Caret Color to Query Editor Prefs - disabled for now.
* - Fixed NSFontPanel issue. Now showing font collections in Font Panelavenjamin2009-05-211-0/+7
| | | | | | - Replaced some toolbar icons with new ones - Edited some toolbar icons. - Added keyboard shortcut section to preferences (Disabled for now)
* • made mySQLConnection reachable for CMTextViewBibiko2009-05-201-0/+2
| | | | | | | • for MySQL version > 4 added proc/func names to the completion suggestion list • changed the way of adding the table names to the completion suggestion list - now it uses [mySQLConnection listTables] instead of taking the names from the table view list due to the header items • added some pragma marks to CMTextView
* New preference to allow the displaying of vertical grid lines in table views.stuconnolly2009-05-191-26/+42
|