Home page for Tod Landis
Hidden Editor Gems
September 17, 2007
These days I spend most of my time working on Entrance, the MySQL browser with charts that Shane Duan and I are developing. There have been more than a thousand downloads of the community and beta versions, and we just released our version "one oh". You will find a ton of information about Entrance here: http://dbentrance.com/
In this blog I will present tips and techniques for using Entrance. Let us begin with Shane's SQL editor...
To bring up the editor, click the "New" button on the Entrance toolbar and enter some SQL commands or "Open" a SQL file. If you need a script, you can copy this example from your browser to a new SQL window in Entrance: http://dbentrance.com/demo/create_country.sql
The editor does color syntax highlighting and, if an error occurs when you run a SQL script, it positions you at the line containing the error. Use the Help menu, which has web bookmarks for the online MySQL documentation,when you need to check your syntax. (Browser settings are configured automatically, but if you need to change them, they are also on the Misc tab of the Preferences dialog)
There are a several useful key combinations that may be overlooked in the Entrance UI:
- Use Command+Enter on the Mac (Control+Enter on other systems) to run a SQL query without
clicking the "Run" button,
- Use Control+T to open the selected text in a query window as a table, and
- Use Command+Shift+R to run the current query and copy its results to the clipboard for pasting to
a spreadsheet
There are also a few hidden gems in the Edit menu, which looks like this on a Mac (On Windows and Linux systems, keyboard shortcuts use the control key where Macs use the command key, but the menu selections are the same):
In addition to undo/redo and the usual cut/copy/paste operations, Entrance provides "Paste from clipboard ring...". Here is how it works. As you copy things to the clipboard, the editor remembers them in a "clipboard ring". Later you can paste any of these items by pressing Alt+Shift+V to bring up the "Paste from clipboard ring..." dialog and selecting it from the list:
As you can see "Replace" made it into our 1.0 release, just under the wire:
Ok, one last hidden editor gem, the Preferences Dialog. Bring it up using Command+, on the Mac or Ctrl-, on other systems, then click the "SQL" tab and you will see this:
You can click the buttons to make changes in Editor colors, then OK, and the new colors persist between sessions.
Copyright (c) 2007 Tod Landis, All Rights Reserved
MySQL is a registered trademark of MySQL AB in the United States, the European Union and other countries.