docs_
Configuration reference and key bindings for sqsh.
Configuration
Full reference for every key supported in config.toml, followed by three complete example configurations. See the README for how to create and locate the config file.
[settings] — Application settings (optional)
| Key | Type | Default | Description |
|---|---|---|---|
language | string | "en" | Display language: "en" or "ja" |
[settings.layout] — Input area heights and result preview pane (optional)
Controls the height (in terminal rows) of each input area on the connected screen, and the size/position of the preview pane in the result viewer. Omitted keys fall back to their defaults.
| Key | Type | Default | Description |
|---|---|---|---|
sql_input_height | integer | 5 | Height of the SQL input area |
shell_input_height | integer | 5 | Height of the Shell input area |
prompt_input_height | integer | 5 | Height of the PROMPT input area (only shown when an Anthropic API key is configured) |
result_preview_width | integer | 30 | Size (in percent) of the preview pane in the result viewer — width when result_preview_position is "left"/"right", height when it is "up"/"down" |
result_preview_position | string | "right" | Position of the preview pane: "up", "down", "left", or "right" |
[settings.layout] sql_input_height = 10 shell_input_height = 5 prompt_input_height = 5 result_preview_width = 30 result_preview_position = "right"
Note: these keys must be placed under the [settings.layout] section, not directly under [settings] — misplaced keys are silently ignored. An invalid result_preview_position value (anything other than "up", "down", "left", or "right") causes a configuration error at startup.
[[connections]] — Connection entry (one or more required)
| Key | Type | Default | Description |
|---|---|---|---|
name | string | — | Connection name (required) |
bastion | see below | omitted | Bastion configuration |
readonly | bool | false | Prevent write operations when true |
bastion field behavior
| Value | Effect |
|---|---|
Omitted or false | Direct connection (no bastion) |
true | Use [default_bastion] settings |
[connections.bastion] table | Use per-connection bastion settings |
[connections.bastion] — Per-connection bastion settings
| Key | Type | Default | Description |
|---|---|---|---|
host | string | — | Bastion server hostname or IP (required) |
port | integer | 22 | SSH port |
user | string | — | SSH username (required) |
key_path | string | — | Path to SSH private key; omit to use SSH agent |
[connections.mysql] — MySQL settings
| Key | Type | Default | Description |
|---|---|---|---|
host | string | — | MySQL hostname or IP (required) |
port | integer | 3306 | MySQL port |
database | string | — | Database name (required) |
user | string | — | MySQL username (required) |
password | string | — | MySQL password (required) |
timeout | integer | 30 | Connection timeout in seconds |
ssl_mode | string | "required" | TLS/SSL mode: "required", "preferred", or "disabled" |
[connections.mysql.pool] — Connection pool settings (optional)
| Key | Type | Default | Description |
|---|---|---|---|
max_connections | integer | 10 | Maximum number of connections |
idle_timeout | integer | 300 | Idle connection timeout in seconds |
[default_bastion] — Shared bastion settings (optional)
Applied to all connections with bastion = true. Fields are the same as [connections.bastion].
[default_mysql_pool] — Shared pool settings (optional)
Applied to all connections that do not specify their own pool settings. Per-connection settings take precedence. Fields are the same as [connections.mysql.pool].
Example 1: Direct connection (local development)
[[connections]]
name = "local-dev"
[connections.mysql]
host = "localhost"
port = 3306
database = "your_database"
user = "root"
password = "your_password"
ssl_mode = "disabled" # acceptable for local developmentExample 2: Shared bastion (production environments)
Use [default_bastion] when multiple connections share the same bastion server.
[default_bastion] host = "bastion.example.com" port = 22 user = "your_ssh_user" # Omit key_path to use your SSH agent (e.g., 1Password SSH agent) [default_mysql_pool] max_connections = 20 idle_timeout = 600 [[connections]] name = "production" bastion = true # uses [default_bastion] [connections.mysql] host = "mysql.internal.example.com" port = 3306 database = "production_db" user = "app_user" password = "secure_password" timeout = 60 ssl_mode = "required" [[connections]] name = "staging" bastion = true # uses [default_bastion] readonly = true [connections.mysql] host = "mysql-staging.internal.example.com" port = 3306 database = "staging_db" user = "app_user" password = "staging_password" ssl_mode = "preferred"
Example 3: Per-connection bastion
Use [connections.bastion] when each connection has a different bastion server.
[[connections]] name = "region-a" [connections.bastion] host = "bastion-a.example.com" port = 22 user = "your_ssh_user" key_path = "~/.ssh/id_rsa" [connections.mysql] host = "mysql-a.internal.example.com" port = 3306 database = "db_a" user = "app_user" password = "password_a" ssl_mode = "required" [[connections]] name = "region-b" [connections.bastion] host = "bastion-b.example.com" port = 2222 user = "your_ssh_user" key_path = "~/.ssh/id_ed25519" [connections.mysql] host = "mysql-b.internal.example.com" port = 3306 database = "db_b" user = "app_user" password = "password_b" ssl_mode = "required"
See config.example.toml in the repository for a complete annotated example.
Key Bindings
Connection Selection
Connection selection is handled by skim (Rust-native fzf). Standard fzf key bindings apply.
| Key | Action |
|---|---|
| Type to filter | Incremental search |
Up / Down | Move cursor |
Enter | Select connection |
ESC / Ctrl+C | Cancel / quit |
SQL Input
SQL input is handled directly by sqsh. Press Tab to switch focus between SQL Input and Shell Input.
Execution and Completion
| Key | Action |
|---|---|
Enter | Execute SQL |
Tab | Switch focus to Shell Input (when completion popup is closed) |
Tab / Down | Next completion candidate (when completion popup is open) |
Shift+Tab / Up | Previous completion candidate |
Ctrl+D | Execute SHOW DATABASES |
Ctrl+T | Execute SHOW TABLES |
Ctrl+S | Column selection mode (table → column picker) |
Editing
| Key | Action |
|---|---|
Ctrl+A | Select all |
Ctrl+C | Copy selection / quit (no selection) |
Ctrl+J | Insert newline (multi-line SQL) |
Ctrl+V | Paste from clipboard |
Ctrl+X | Cut selection |
Ctrl+K | Delete from cursor to end of line |
Ctrl+U | Delete from start of line to cursor |
Ctrl+W | Delete previous word |
Ctrl+Y | Paste from kill buffer |
Ctrl+E | Move cursor to end of line |
Home / End | Move cursor to start / end of line |
Alt+← / Alt+→ | Move cursor one word left / right |
Shift+← / Shift+→ | Extend selection left / right |
Alt+Shift+← / Alt+Shift+→ | Extend selection one word left / right |
Navigation and Other
| Key | Action |
|---|---|
Up / Down | Navigate SQL history |
ESC | Clear input / close completion popup |
q (empty input) | Quit |
Shell Input
Shell Input allows running shell commands without leaving sqsh. Press Tab to switch focus from SQL Input.
When connected via a bastion server, commands execute on the bastion host. For direct connections, commands execute locally.
| Key | Action |
|---|---|
Enter | Execute command |
Ctrl+J | Insert newline (multi-line command) |
Tab | Switch focus to SQL Input |
Up / Down | Navigate shell history |
Ctrl+A / Home | Move cursor to start |
Ctrl+E / End | Move cursor to end |
Ctrl+K | Delete from cursor to end |
Ctrl+U | Delete from start to cursor |
Ctrl+W | Delete previous word |
Alt+← / Alt+→ | Move cursor one word left / right |
ESC | Clear input |
Ctrl+C | Quit |
Result Viewer
Result display is handled by skim (Rust-native fzf). Standard fzf key bindings apply.
| Key | Action |
|---|---|
| Type to filter | Incremental search |
Up / Down | Scroll through results |
Enter | Select record (generates WHERE template) |
ESC / Ctrl+C | Return to SQL input |