aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.m
Commit message (Collapse)AuthorAgeFilesLines
* Rework alert sheets:rowanbeentje2010-05-091-13/+13
| | | | | | | - 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
* Review trigger fetching and storage:rowanbeentje2010-05-011-40/+40
| | | | | | | - Trigger queries are no longer made for MySQL < 5.0.2 - Trigger loading has been deferred until the trigger tab is active, reducing queries when switching tables and thus increasing overall responsiveness - Export triggers in MySQL dumps even if the Table Content switch is unchecked
* - Allow CMTextView to track SPNarrowDownCompletion state, ensuring old ↵rowanbeentje2010-04-221-0/+1
| | | | | | | windows are closed. This also allows SPNarrowDownCompletion to be closed when CMTextView is deallocated; this should fix http://spbug.com/l/139 . - Fix some minor memory leaks
* - Fix .sql.gz extension when exporting databases to SQL when the ↵rowanbeentje2010-04-171-2/+2
| | | | compression setting has been saved as on
* Review usage of notifications, afterDelay: and waitUntilDone:NO calls:rowanbeentje2010-04-121-1/+1
| | | | | | | - Add more calls to deregister watchers to fix crashes to closing threads or objects - Fix a couple of memory leaks - Alter a few calls to be performed on main thread (afterDelay: operates on the thread is is called on) - this fixed database reloading after import and field/index deletion error sheets
* preserve path name selection only if user ticks the 'compress dump' checkbox ↵Bibiko2010-04-121-0/+11
| | | | in mysql dump save panel (thanks to rowan)
* • Export compressed mysql dumpBibiko2010-04-121-2/+14
| | | | - first fixes to support sql.gz extension better in the NSSavePanel
* Add a new SPFileHandle class to support gzip compression and writing on a ↵rowanbeentje2010-04-121-36/+72
| | | | | | | | | | | background thread, and integrate for SQL import: - Implement streaming reading of gzip-compressed files for SQL import - Support exporting SQL dumps into a gzip-compressed file - SPFileHandle supports the most-used subset of NSFileHandle commands for easy integration - Integrate zlib 1.2.4 for improved gzip streaming performance (and support for custom buffer sizes and file offset positions) This implements Issue #571 .
* • Import from ClipboardBibiko2010-04-101-0/+2
| | | | - forgotten to remove the temp file after importSQL successfully
* • added "Import from Clipboard" ⌥⇧⌘IBibiko2010-04-101-13/+123
| | | | | | - sheet showing the first 4kB of pasteboard content and the SQL/CSV accessory view - pasteboard content will be saved as temp file and read by using the current table/connection encoding
* • CSV ImportBibiko2010-04-061-8/+45
| | | | | - ensure that if the connection is lost while importing all relevant allocated objects are released including the import pool - any error which cancels the import process will also release all retained global variables coming from the field mapper
* - Improve error checking for various actions, particularly permissions ↵rowanbeentje2010-03-311-7/+33
| | | | errors (NULL data returned) for views and stored procedures. This should fix http://log.sequelpro.com/view/27 , http://log.sequelpro.com/view/57 , and the last of http://log.sequelpro.com/view/53
* • some speed improvements and code simplifications for navigatorBibiko2010-03-301-0/+3
| | | | | | • avoid making the completion key list unique since it's possible to insert unique items only • added trigger to query db structure after SQL import • some work to avoid http://log.sequelpro.com/view/90 (not yet ideally - WIP)
* - Make [MCPConnection getLastErrorMessage] more consistent by always ↵rowanbeentje2010-03-251-12/+12
| | | | | | | 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-10/+10
| | | | SPConstants.h/m.
* • CSV Import Field MapperBibiko2010-03-221-37/+44
| | | | | - added the chance to mark a global value as SQL statement in the sheet to allow to use a calculated value like LENGTH(`foo`) or NOW() while inserting/replacing/updating • added ^⌥⌘N short-cut Navigator (still hidden)
* • CSV ImportBibiko2010-03-221-2/+15
| | | | | | | | - if a parsed row in the csv file doesn't have the same number of columns as the first row fill the missing columns with SPNotLoaded to allow while importing that these missing data can be replaced by the table column's DEFAULT value - fixed tiny issue for field mapper sheet to display the correct tooltip for default values • SPTableData - ATTENTION: changed the object for returned key 'default': if its value is NULL now it returns a [NSNull null] object - changed instances to handle this [NSNull null] object (must be checked)
* • fixed bug while CSV importBibiko2010-03-221-6/+9
| | | | - calculate correctly whether global variables are used or not to avoid a crash if the number of columns in the csv file differs
* - Add a new SPMainThreadTrampoline NSObject category, allowing all ↵rowanbeentje2010-03-201-135/+123
| | | | | | | | | | | | | | | NSObjects to easily proxy commands onto the main thread with any number and type of arguments. - Use the new trampoline and other thread safety tweaks to hopefully address a number of what appear to be threading issues: http://log.sequelpro.com/view/20 http://log.sequelpro.com/view/32 http://log.sequelpro.com/view/41 http://log.sequelpro.com/view/42 http://log.sequelpro.com/view/55 http://log.sequelpro.com/view/64 http://log.sequelpro.com/view/65 http://log.sequelpro.com/view/66
* - Make a number of changes to attempt to improve disconnection/quit ↵rowanbeentje2010-03-161-5/+5
| | | | | | | | | 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.
* Fix a couple more potential issues found during static analysis.stuconnolly2010-03-151-1/+1
|
* - Fix some leaks and autoreleases after checking static analysisrowanbeentje2010-03-131-1/+1
|
* • fixed printing of Extended Table Info if Create Table Syntax view has focusBibiko2010-03-131-1/+1
| | | | | - regardless of focus it prints the table info sheet - only if user selects something then the create syntax will be printed
* - Fix the "Import" button for the "Do you really want to load a [large] SQL ↵rowanbeentje2010-03-101-0/+1
| | | | file" dialog if no imports have been performed in the session
* • CSV Import Field MapperBibiko2010-03-051-0/+34
| | | | - implemented "Insert remaining rows" for import method UPDATE; if the UPDATE statement does't affect any row and this row via INSERT INTO…
* • CSV Import Field MapperBibiko2010-03-051-1/+2
| | | | | | | | | | | - removed Advanced sheet, instead resize the main sheet and display these settings in it - added advanced options LOW/HIGH_PRIORITY - improved logic for adv. settings, disabling UPDATE if target table has less than 2 fields, etc. - fixed URL for displaying the source file name - removed Help text since it's too large - should be go to the general help • CMTextView - fixed bug if ESC Completion is invoked if caret position is 0 • fixed document URL handling to come up with the correct icons etc.
* • CSV Import Field MapperBibiko2010-03-041-27/+141
| | | | | | | - added UPDATE method which allows to configure an import statement à la: UPDATE t1 SET col1=foo1, col2=foo2 WHERE col3=baz1 AND col4=baz2 - Insert remaining rows (which are not matched) isn't implemented yet - note: further tests are needed to ensure it works as expected
* • CSV Import Field MapperBibiko2010-03-031-0/+1
| | | | - further work on UPDATE (not yet activated)
* • CSV Field MapperBibiko2010-03-021-1/+1
| | | | | | - REPLACE as import method is only enabled if target table has a primary key or at least one field which is set to unique - if user set a field to "Ignore Field" display as "import value" the field's default value greyed - some minor code cosmetics
* • this commit should fix the displaying the correct read file size and the ↵Bibiko2010-02-211-6/+6
| | | | | | | file size while importing very large CSV/SQL - replaced deprecated method fileAttributesAtPath:traverseLink: by attributesOfItemAtPath:error: - fix for i549
* • CSV Import Field MapperBibiko2010-02-211-4/+22
| | | | | - added Advanced sheet for setting IGNORE, DELAYED, ON DUPLICATE KEY UPDATE '<string>' for INSERT/REPLACE INTO • if during import CSV Import an error occurred show SP Console
* • CSV Import Field MapperBibiko2010-02-181-1/+1
| | | | - fixed bug, detect if csvimportarray contains global vars correctly
* • CSV Import Field MapperBibiko2010-02-181-1/+15
| | | | | - allow to define a list of global variables (incl. a true NULL value) - such a global variable will be inserted into the mapped table target field for all rows imported
* • TableDumpBibiko2010-02-171-25/+17
| | | | | | | | - introduced new method: - (void)showErrorSheetWithMessage:(NSString*)message to unify it and made all error sheets doc-modal (not app-modal) - Close button of the errorSheet now also listens at ESC
* • csv file import mapperBibiko2010-02-171-2/+12
| | | | | | - added button "Go Back" ⌥← to go back to the file chooser (mainly for correcting delimiter etc.) - improved selecting csv file columns for the case that column was set as 'Do not import'; now if set to 'Do not import' the value is hidden, click the user on it the popup menu appears and the operator is set to 'Do import' automatically • TableDump now remembers the last chosen csv file name
* • field mapper controllerBibiko2010-02-161-5/+6
| | | | | | | | | | - fixed precocious releasing of mapper settings - fixed boolean binding for displaying "1 of first 100 records" - added further gui elements (not yet activated) - sheet dimensions are now auto-saved - bound keystroke ⇢ and ⇠ to row stepper - renamed some stuff - added clarification notes
* • re-factored and outsourced the entire CSV import field mapper sheetBibiko2010-02-161-179/+41
| | | | | | | | | | | | | | | | | | - changed the way to choose whether a source field should be imported or not by introducing a new table column 'operators' - clicking at the 'operator's header toggles all operators to 'Import' or 'Do not import' - added tooltips for each table cell; if file's first line are the headers show them in the tooltips as well - added checkbox "First line contains fields names" since it'll be clear in this pane whether a file has a header line or not (will be sync with prefs) - added the possibility to choose the import method: INSERT INTO or REPLACE INTO • deleted all old field mapper stuff from TableDump and DBView.xib Notes: - tests are needed to be sure that this change does not cause mismatches while importing - symbols for Do (not) import are tendative - maybe use images - a further import method UPDATE plus an operator '=' will be added soon - chance to add a new global source variable will come soon - displaying of source field types will come soon - semi-automatically matching of source field names and header names will come soon - the GUI needs some improvements afterwards
* Fix a number of memory leaks, and over-releases, as both a result of manual ↵rowanbeentje2010-02-101-2/+8
| | | | inspection of leaks and Clang static analysis.
* • some further work at the new field mapper sheetBibiko2010-02-051-4/+7
|
* - Rework SPSQLParser, extending DELIMITER support into all the original ↵rowanbeentje2010-02-051-43/+91
| | | | | | | | | | | 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)
* • field mapping sheet is now document-modal instead of blocking SP entirelyBibiko2010-02-031-9/+24
| | | | | | | • if an error occurred while retrieving column or index data in Structure pane reset Structure pane to a stable status, display the error message, and reload Tables List table due to the fact the it's very likely that SP tries to retrieve data from a table which doesn't exist anymore • fixed spelling of "occurred" Note: NOT YET DONE: if in Structure view the actual underlying table was deleted or renamed by an other mysql event and the user tries to add/change a field do suppress this attempt safely
* - When exporting CSVs containing linebreaks, no longer escape those ↵rowanbeentje2010-01-221-7/+5
| | | | linebreaks if they are within a quoted cell, improving compatibility with other applications (notably Excel)
* Address Issue #546 (format string bugs):rowanbeentje2010-01-201-13/+14
| | | | | | - 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
* Issue 517: Export MySQL Dump does not include triggers or functionsbamse162010-01-141-58/+65
| | | | | | - added support for dump functions. If no errors are found, Issue 517 can be closed.
* Issue 517: Export MySQL Dump does not include triggers or functionsbamse162010-01-141-5/+71
| | | | | | - included export for proceduers. Need to add support for functions and test on different databases.
* • fix for i529: set the savePanel's delegate to self in order to handle ↵Bibiko2010-01-131-1/+3
| | | | changes of the accessory view (ie avoid disappearing of selected items)
* Issue 517: Export MySQL Dump does not include triggers or functions bamse162010-01-121-36/+46
| | | | | | | I've moved the export triggers part after the [streamResult release], so we can export triggers for empty tables too.
* Issue 517: Export MySQL Dump does not include triggers or functionsbamse162010-01-111-8/+43
| | | | | | | | | | | | | | First draft on export triggers. Known issues: - Now it exports only triggers for the table that have some content in it. If I move the write triggers part outside of the if (rowCount), the SHOW TRIGGERS query never finishes. - Sequel Pro complains when it tries to import the same file again. The error message is related to DELIMITER command. Still, the triggers seem to be present. This might be a different issue with Sequel Pro.
* - Upgrade Sequel Pro to be compiled as a 3-way PPC/i386/x86_64 binary for ↵rowanbeentje2010-01-091-64/+64
| | | | | | | release builds, including a large number of 64bit compatibility upgrades and tweaks - Upgrade RegexKitLite to 3.3
* - Ensure all results for server variable requests are returned as strings, ↵rowanbeentje2010-01-031-0/+2
| | | | | | | to avoid binary-mode result issues with certain versions of MySQL (including 4.1.14). This should address Issue #509. - TableDocument now requests the server version string from MCPConnection, aiding caching