spacemacs/layers/+lang/sql/README.org

61 lines
2.7 KiB
Org Mode
Raw Normal View History

#+TITLE: SQL layer
2015-06-10 16:44:30 +00:00
[[file:img/sql.png]]
2016-03-31 02:59:55 +00:00
* Table of Contents :TOC_4_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description][Description]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]
- [[#highlighting][Highlighting]]
- [[#inferior-process-interactions-sqli][Inferior Process Interactions (SQLi)]]
- [[#send-sql-queries-to-sqli][Send SQL queries to SQLi:]]
- [[#sqli-buffer][SQLi buffer]]
2015-06-10 16:44:30 +00:00
* Description
This layer adds key bindings and configuration for =sql-mode=, which manages
interactive SQL buffers and highlights a wide range of SQL dialects.
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =sql= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-06-10 16:44:30 +00:00
* Key bindings
** Highlighting
| Key Binding | Description |
|-------------+-----------------------------------|
| ~SPC m h k~ | select a SQL dialect to highlight |
** Inferior Process Interactions (SQLi)
| Key Binding | Description |
|-------------+-----------------------------|
| ~SPC m b b~ | show the SQLi buffer name |
| ~SPC m b s~ | set the SQLi buffer |
| ~SPC m l a~ | List all objects |
| ~SPC m l t~ | list all objects in a table |
*** Send SQL queries to SQLi:
2015-06-10 16:44:30 +00:00
2016-01-31 20:44:59 +00:00
| Key Binding | Description |
|-------------+---------------------------------------------------------------------------------------|
| ~SPC m s b~ | Send the whole buffer to the SQLi buffer |
| ~SPC m s B~ | Send the whole buffer to the SQLi buffer and switch to it in =insert state= |
| ~SPC m s i~ | Start the SQLi process |
| ~SPC m s f~ | Send the paragraph around point to the SQLi buffer |
| ~SPC m s F~ | Send the paragraph around point to the SQLi buffer and switch to it in =insert state= |
2016-01-31 20:44:59 +00:00
| ~SPC m s q~ | Prompt for a string to send to the SQLi buffer |
| ~SPC m s Q~ | Prompt for a string to send to the SQLi buffer and switch to it in =insert state= |
| ~SPC m s r~ | Send the selected region to the SQLi buffer |
| ~SPC m s R~ | Send the selected region to the SQLi buffer and switch to it in =insert state= |
2015-06-10 16:44:30 +00:00
** SQLi buffer
| Key Binding | Description |
|-------------+--------------------------------------------------------------|
| ~SPC m b r~ | rename buffer (follow up in the SQL buffer with ~SPC m b s~) |
| ~SPC m b S~ | save the current connection |