Writing SQL is such a fundamental part of interacting with a relational database that we put this functionality front and center.
You can use the SQL query tab to write, and run, SQL queries quickly and easily.
We have tried to make our code completion useful but not intrusive.
Code suggestions will automatically appear in the following situations:
tableswill be suggested after typing
columnswill be suggested after typing a tablename, or table alias, followed by a period, eg
In these situations, Beekeeper will automatically resolve the correct table and column names for the entity you are querying.
Manually triggering autocomplete
The default key combo to manually trigger autocomplete is
Cmd+Space for MacOS users.
If you like writing big long SQL scripts with multiple queries in the same editor pane (I know I do), you might want to only run a portion of your script at a time.
Beekeeper allows you to:
- Run everything (this is the default)
- Run only the 'current' query (Beekeeper highlights this query for you so you know what will run)
- Run only what you have selected.
You can parameterize your queries and Beekeeper will prompt you for values when you run it.
You can use three types of syntax
? depending on the database engine you are querying.
When you run a query, the results will appear right underneath the SQL editor, simple!
If you run multiple SQL queries, you can select different result sets with the dropdown on the status bar. You'll get a little popup to tell you about it the first time you do it.
If you run a query that generates a result set of more than 50,000 records Beekeeper will truncate the result table (to conserve memory).
In the commercial edition of Beekeeper Studio, you can also select
Run To File, this will run your SQL query and send the full results directly to a CSV file.
Along with the default query editor, Beekeeper supports Vim mode, which allows you to write queries in a Vim-like text editor.
To enable this, you can click the cog in the bottom left corner of the query editor:
And then you're off to the races with a vim editor in Beekeeper!
Whichever editor you prefer will be preserved across all connections/restarts/etc.
You can also add your own keybindings and motions to the vim editor by placing a
.beekeeper.vimrc file in the
userDirectory for Beekeeper Studio and writing out your custom mappings.
For instance, if you're a Helix user, you can add
gh commands like this:
These commands add motions for
gl to go to the end of a line, and
gh to go to the beginning of a line
We currently only support the
vmap commands, but we hope to introduce more in the future!