aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
Commit message (Collapse)AuthorAgeFilesLines
* When editing the results from a custom query, reloading will only be ↵jakob2010-07-011-6/+10
| | | | performed when the "Reload after editing"-preference is selected (addresses #735)
* - Ensure start/end query notifications are sent on the main thread to avoid ↵rowanbeentje2010-06-011-3/+3
| | | | | | | the interface being updated from the wrong thread on listeners - Add a "Support Files" folder to MCPKit, containing NSNotificationAdditions to support main thread notifications from within MCPKit
* Rename TableDocument to SPDatabaseDocument.stuconnolly2010-05-281-2/+2
|
* Rename TablesList to SPTablesList.stuconnolly2010-05-271-1/+1
|
* Initial implementation of tabs:rowanbeentje2010-05-231-18/+18
| | | | | | | | - 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
* - Fix a problem caused when trying to run custom queries terminated by a ↵rowanbeentje2010-05-091-0/+4
| | | | partial letterform, eg an unapplied accent. (Addresses http://spbug.com/l/260)
* Rework alert sheets:rowanbeentje2010-05-091-5/+5
| | | | | | | - Change MCPConnection.m to no longer use a reference to tableWindow to attach sheets - instead use a delate error display method if available - Rework TableSource and TableContent sheetDidEnd methods into per-task methods rather than overloading contextInfo - Rework SPAlertSheets to perform actions on the main thread, with the loss of (unused) support for a didDismissSelector. This addresses a number of crashes logged by the crash reporter
* - Fix an intermittent crasher - occurring most often when sorting tables - ↵rowanbeentje2010-04-021-1/+1
| | | | by using copies of data store objects when the data store is being updated. This addresses http://log.sequelpro.com/view/20 and http://log.sequelpro.com/view/88
* - Make [MCPConnection getLastErrorMessage] more consistent by always ↵rowanbeentje2010-03-251-4/+4
| | | | | | | returning nil if no error occurred (previously a blank string was returned most of the time) - Add a new (BOOL)[MCPConnection queryErrored] method, changing all error message checks to use it for clarity
* General tidy up, with a focus on consolidating more constants in ↵stuconnolly2010-03-241-1/+1
| | | | SPConstants.h/m.
* - Remove observers for key paths when dealloc'ing objects to fix later ↵rowanbeentje2010-03-231-0/+1
| | | | | | | crashes when changing those keyvalues (eg changing query editor background colour after closing windows - http://log.sequelpro.com/view/44 ) - Fix a memory leak of a prefs reference in CMTextView
* - Simplify table source table setup and make thread safe. This should ↵rowanbeentje2010-03-221-13/+14
| | | | | | | | address http://log.sequelpro.com/view/43 , http://log.sequelpro.com/view/46 - Improve keepalive timer interaction - this should address http://log.sequelpro.com/view/74 and http://log.sequelpro.com/view/71 - Further thread safety improvements to Custom Query, Table Document, and the history controller
* - Alter historyItemsHaveBeenUpdated: call on startup to be performed on ↵rowanbeentje2010-03-201-1/+1
| | | | main thread without a delay to fix http://log.sequelpro.com/view/33
* - Fix a couple of calls which crashed if the window had already been ↵rowanbeentje2010-03-181-0/+4
| | | | | | | closed, fixing window close on query startup or after queries; this fixes http://log.sequelpro.com/view/9 - Fix an exception caused in the NavigatorController if the dbstructure has not been fetched yet
* - Make a number of changes to attempt to improve disconnection/quit ↵rowanbeentje2010-03-161-3/+4
| | | | | | | | | crashes: prevent multiple disconnects, add more checks, cancel current queries, and add a tiny delay to allow mysql cleanup. - Alter MCPStreamingResult to no longer return a retained instance, setting up correct result disposal on autorelease but changing callers to retain as soon as they receive. - Review and change a number of local variables shadowing/shielding other local or global variables.
* Following a manual code review, fix some local variables overriding global ↵rowanbeentje2010-03-151-0/+2
| | | | variables, a few leaks, and additional nil setting/checking to prevent overreleases or releases of random areas of memory.
* Rework the running of custom queries, improving thread safety by splitting ↵rowanbeentje2010-03-121-114/+147
| | | | 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
* Various printing support enhancements, including:stuconnolly2010-03-121-2/+2
| | | | | | | | | - Splitting out all printing methods to SPPrintController which is category of TableDocument. - The ability to print table relations. - If present the inclusion of table indexes when printing a table's source. - If the user has use monospaced fonts enables, then the print out's tabular data will be in a monospaced font. - Lots of other style enhancements, including page headings and sections headings.
* - If using an untitled connection (eg non-spf), default to saving queries ↵rowanbeentje2010-03-101-0/+2
| | | | to the global favourites list
* • forgot to shorten SP_ASLIST_ALL_FIELDS in CustomQuery as wellBibiko2010-03-091-1/+1
|
* • added $SP_ASLIST_ALL_FIELDS_FROM_SELECTED_TABLE as pre-defined snippet listBibiko2010-03-091-0/+15
| | | | | • 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-2/+11
| | | | probably caused by non-thread-safe menu interaction. This addresses http://log.sequelpro.com/view/19
* - Add a check for valid columns - this addresses ↵rowanbeentje2010-03-071-0/+1
| | | | http://log.sequelpro.com/view/25
* • added to CustomQuery's CMTextView the option to set auto-completion ↵Bibiko2010-03-071-3/+3
| | | | | | on/off, settable in Prefs and gear menu - if inserted completion is marked as function it inserts snippet (${}1:) so far; function parameters as snippets follows soon
* • fixed threading issue if user performs query in Custom Query all the ↵Bibiko2010-02-181-8/+2
| | | | | | | time by holding down ⌘R for a long time caused by updating the history - removed unnecessary updating of the historyButton - updating of all docs is now performedOnMainThread:waitUntilDone:NO
* - Implement result view saving in a more general way within CustomQuery; ↵rowanbeentje2010-02-111-19/+89
| | | | now when editing custom query results *and* sorting custom query results, scroll position and selection index are preserved
* (no commit message)Bibiko2010-02-051-5/+7
|
* • fixed synchronisation of history lists if more than one instance of the ↵Bibiko2010-02-051-32/+16
| | | | | | same SPF file is open - simplified code a bit
* • forgotten to remove debug logsBibiko2010-02-051-2/+0
|
* • refactored the entire history logic in Custom QueryBibiko2010-02-051-31/+74
| | | | | | - 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
* - Rework SPSQLParser, extending DELIMITER support into all the original ↵rowanbeentje2010-02-051-4/+8
| | | | | | | | | | | functions (off by default). Remove the forked "...Sql..." functions, as they're now duplicates, and switch CustomQuery to using the original methods. - TableDump imports can now process DELIMITERs correctly as a result. - Alter the TableDump display of tables etc to use TablesList as the source of information, and used cached lists where appropriate for a small speedup. Also means we gain consistent sorting. - Display procedures and functions in the toggleable list when exporting as SQL - Tweak the procedure and function export to only export selected items, and also to respect the "export drop syntax" and "export create syntax" checkboxes - Fix a crash when removing items from the TablesList resulted in an errorneous selection by deselecting all rows before deleting (and preemptively applying the same fix to TableContent)
* • fixed undo behaviour of insertion of history/query favsBibiko2010-02-041-3/+6
| | | | • improved text macro/query favs insertion logic
* • added key-shortcut ⌘= to make the textview size largerBibiko2010-02-021-20/+0
| | | | | | | | • ⌘-, ⌘+, ⌘= changes the font size temporarily (Mac app conform) • added key-shortcut ⌘0 to reset the font to pref default • fixed search field background for Tables List • fixed NSUInteger for completion parsing; interrupt completion if parsed string length is larger than 100000 since it doesn't make sense and leads to warnings
* • Content Table and Query Editor table's tooltip are displayed by using ↵Bibiko2010-01-311-1/+8
| | | | | | the same font/size as the table cells • CMTextView: make sure that some methods are never called if the CMTextView is set to 'not ediable'
* • CMTextView's colours are set via observer, live changed in editable ↵Bibiko2010-01-301-29/+15
| | | | | | | | textviews • added Preference setting "Table font" in "Table" pane to set the table font/size for all result tables (Content, Custom Query) • added to SPTableView the method setFont: • fixed the initialisation of vars in CMTextView (fixes the displaying of create syntax)
* Rework CMCopyTable copy functionality and related code:rowanbeentje2010-01-301-1/+1
| | | | | | | | | | - Reverse the effects of the r1664/r1690 combination, restoring the original link from CMCopyTable to the underlying data source - Adapt the code to retrieve information from the new SPDataStorage; update SPDataStorage as necessary if underlying data changes - Refactor and speed up various checks and loops for speed and logic improvements - Ensure the binary-encoded TEXT data is hex encoded rather than retrieved as "<123ABC 123ABC...>" NSData representations - Fix some memory leaks This resolves Issue #533 and the original "Copy as SQL" issue
* • suppress the display of table cell tooltips if TableDocument isWorking ↵Bibiko2010-01-301-1/+1
| | | | to avoid unstable tooltip status
* • added observer for all Query Editor colors to avoid initialising colors ↵Bibiko2010-01-301-0/+10
| | | | | | each time for syntax highlighting which speed it up a bit; now if one changes a color the changes are done in view after a delay of 0.1 s if text buffer < 100k for speed reasons • fixed: before highlighting the current query ensure that the text storage is in a stable and clean status; otherwise SP crashes for ranges which aren't rendered yet
* • current query highlighting is done now in drawRect: (much more faster ↵Bibiko2010-01-301-43/+14
| | | | | | | | 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)
* • text macro logicBibiko2010-01-291-3/+4
| | | | | | | - improved highlighting of multi-line snippets (many thanks to jabakobob for this patch!) - some tiny cosmetics • error message highlighting in Custom Query Editor - removed near message length checking to be larger than 2, not necessary
* • further tiny improvements to avoid exceptional cases while highlighting ↵Bibiko2010-01-291-4/+17
| | | | | | | | | the erroneous query - added check for near message length - make an intersection with the buffer range before selecting • text macro - each selection of a snippet breaks the undo buffer - note: undo behaviour while text macro session is active needs to be solved ⇢ work in progress
* • fixed some issues and improved the text macro behaviourBibiko2010-01-291-1/+8
|
* • for [CMTextView selectLineNumber:…] added safety-check for lineNumber < 1Bibiko2010-01-281-7/+12
| | | | | | | | • error message highlighting in CustomQuery - check for error ID 1064 before trying to select the erroneous line given as '… at line x' (this solves the issue that other error messages could end by a number) - improved regexp to get rid of localized error messages for parsing the erroneous line number (thanks to Jakob) - look the last number in a string - improved regexp to parse for the 'near message' for localized error messages
* • improved the graphical representation of text macro snippetsBibiko2010-01-271-1/+1
|
* • corrected regex to trigger table/db reload after executing a query in ↵Bibiko2010-01-261-2/+3
| | | | the Query Editor
* • added possibility to add a query favorite by user-definable alphanumeric ↵Bibiko2010-01-241-3/+21
| | | | | | | | | tab trigger; eg if tab trigger is set to "sel" sel⇥ will insert the first query which has the defined the tab trigger • preparations to insert programmable query favorites - eg "SELECT ${*} FROM ${Table}" -- after insertion "SELECT * FROM Table" the '*' is highlighted to change, press ⇥ to select the next snippet 'Table'; ⇧⇥ selects the previous snippet; the snippet selection follows the user input - Note: not yet active
* • bound Custom Query gear menu item "Completion List" (CTRL key is ↵Bibiko2010-01-221-1/+4
| | | | | | | recognized) • use regexp to get a list of current words and reduced that method to invoked if the text buffer is less than 60KB to speed up the completion (it's more likely that the user wants to complete a sql related term) • some code cosmetics
* • avoid updating TablesList for queries in Custom Query Editor à la "SHOW ↵Bibiko2010-01-211-1/+1
| | | | CREATE …"
* Address Issue #546 (format string bugs):rowanbeentje2010-01-201-5/+6
| | | | | | - Fix incorrect uses of [NSString stringWithFormat:] with preconstructed strings and no arguments in SPUserManager - To fix display issues, replace NSBeginAlertSheet (which includes automatic sprintf expansion of the message) with a safely-escaped SPBeginAlertSheet in many files
* Add a new SPDataStorage class, and use it in TableContent and CustomQuery:rowanbeentje2010-01-171-33/+31
| | | | | | | | - 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)