Bear Grylls: "Out here in the wild database ecosystem, efficiency means survival. See that squirrel? That’s Squix, or Sequillis termius. He doesn’t panic-write queries under pressure. He prepares. He caches. He optimizes. While others are wrestling with joins in the dark, Squix already has his results. Extraordinary creature."
A minimal CLI tool for managing and executing SQL queries across multiple databases. Written in Go, made beautiful with BubbleTea
Quick Start • Configuration • Database Support • Dbeesly • Features • Commands • TUI Navigation • Roadmap • Contributing
This project is currently in beta, please report unexpected behavior through the issues tab
Try out the live demo (no install required!)
- Query Library - Save and organize your most-used queries
- Runs in the CLI - Execute queries with minimal overhead
- Multi-Database - Works with PostgreSQL, MySQL, SQLite, Oracle, SQL Server, ClickHouse and Firebird
- Table view TUI - Keyboard focused navigation with vim-style bindings
- In-Place Editing - Update cells, delete rows and edit your SQL directly from the results table
- Export your data - Export your data as CSV, JSON, SQL, Markdown or HTML tables
Go to the releases page and find the correct version for your system. Download it and make sure the file is executable and moved to a directory in your $PATH.
Go install
Use go to install squix directly
go install github.com/eduardofuncao/squix/cmd/squix@latestthis will put the binary squix in your $GOBIN path (usually ~/go/bin)
Build Manually
Follow these instructions to build the project locally
git clone https://github.com/eduardofuncao/squix
go build -o squix ./cmd/squixThe squix binary will be available in the root project directory
Nix / NixOS (Flake)
Squix is available as a Nix flake for easy installation on NixOS and systems with Nix.
nix run github:eduardofuncao/squixnix profile install github:eduardofuncao/squixnix develop github:eduardofuncao/squixAdd to your flake-based configuration.nix or flake.nix:
{
description = "My NixOS config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
squix.url = "github:eduardofuncao/squix";
};
outputs = { self, nixpkgs, squix, ... }: {
nixosConfigurations.myHostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
environment.systemPackages = [
squix.packages.x86_64-linux.default
];
}
];
};
};
}Then rebuild: sudo nixos-rebuild switch
Add to your home.nix or flake config:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nix-unstable";
squix.url = "github:eduardofuncao/squix";
};
outputs = { self, nixpkgs, squix, ... }: {
homeConfigurations."username" = {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [
{
home.packages = [
squix.packages.x86_64-linux.default
];
}
];
};
};
}Then apply: home-manager switch
# Create your first connection (PostgreSQL example)
squix init mydb postgres "postgresql://user:pass@localhost:5432/mydb"
# Add a saved query
squix add list_users "SELECT * FROM users"
# List your saved queries
squix list queries
# Run it, this opens the interactive table viewer
squix run list_users
# Or run inline SQL
squix run "SELECT * FROM products WHERE price > 100"Once your query results appear, you can navigate and interact with the data:
# Use vim-style navigation or arrow-keys
j/k # Move down/up
h/l # Move left/right
g/G # Jump to first/last row
# Copy data
y # Yank (copy) current cell
v # Enter visual mode to select multiple cells and copy with y
x # Export selected data as csv, tsv, json, sql, markdown or html
# Edit data directly
u # Update current cell (opens your $EDITOR)
D # Delete current row
# Modify and re-run
e # Edit the query and re-run it
# Exit
q # Quit back to terminalSquix stores its configuration at ~/.config/squix/config.yaml.
All queries are automatically limited to prevent fetching massive result sets. Configure via default_row_limit in config or use explicit LIMIT in your SQL queries.
The width for all columns in the table TUI is fixed to a constant size, which can be configured through default_column_width in the config file. There are plans to make the column widths flexible in future versions.
Customize the terminal UI colors with built-in schemes:
Available schemes:
default, dracula, gruvbox, solarized, nord, monokai
black-metal, black-metal-gorgoroth, vesper, catppuccin-mocha, tokyo-night, rose-pine, terracotta
Each scheme uses a 7-color palette: Primary (titles, headers), Success (success messages), Error (errors), Normal (table data), Muted (borders, help text), Highlight (selected backgrounds), Accent (keywords, strings).
Control which UI components are displayed in the table view:
ui_visibility:
query_name: true # Show query name header
query_sql: true # Show SQL query display
type_display: true # Show column type indicators
key_icons: true # Show primary key (⚿) and foreign key (⚭) icons
footer_cell_content: true # Show current cell preview in footer
footer_stats: true # Show row/col count and position in footer
footer_keymaps: true # Show keybindings help in footerTip: Press ? in the table view to toggle the keymaps help on/off.
Examples of init/create commands to start working with different database types
squix init pg-prod postgres postgres://myuser:mypassword@localhost:5432/mydb?sslmode=disable
# or connect to a specific schema:
squix init pg-prod postgres postgres://myuser:mypassword@localhost:5432/mydb?sslmode=disable schema-namesquix init mysql-dev mysql 'myuser:mypassword@tcp(127.0.0.1:3306)/mydb'
squix init mariadb-docker mariadb "root:MyStrongPass123@tcp(localhost:3306)/forestgrove"squix init sqlserver-docker sqlserver "sqlserver://sa:MyStrongPass123@localhost:1433/master"squix init sqlite-local sqlite file:///home/eduardo/dbeesly/sqlite/mydb.sqlitesquix init oracle-stg oracle "oracle://myuser:mypassword@localhost:1521/XEPDB1"
# or connect to a specific schema:
squix init oracle-stg oracle "oracle://myuser:mypassword@localhost:1521/XEPDB1" schema-namesquix init clickhouse-docker clickhouse "clickhouse://myuser:mypassword@localhost:9000/forestgrove"squix init firebird-docker firebird user:masterkey@localhost:3050//var/lib/firebird/data/the_officeSquix provides intelligent tab completion for bash, zsh, and fish. Completions are dynamic - they automatically include your saved queries and connections.
Bash
# Temporary (current session)
source <(squix completion bash)
# Permanent (add to ~/.bashrc)
echo 'eval "$(squix completion bash)"' >> ~/.bashrcZsh
# Temporary (current session)
autoload -U compinit && compinit
source <(squix completion zsh)
# Permanent (add to ~/.zshrc)
echo 'autoload -U compinit && compinit' >> ~/.zshrc
echo 'eval "$(squix completion zsh)"' >> ~/.zshrcFish
# Fish loads completions automatically from ~/.config/fish/completions/
squix completion fish > ~/.config/fish/completions/squix.fish
# Restart your shell or run: exec fishAfter installation, press TAB to autocomplete:
squix [TAB] # List all commands
squix run [TAB] # List queries from current connection
squix switch [TAB] # List connection names
squix info [TAB] # List: table, view
squix list [TAB] # List: queries
squix edit [TAB] # List queries to editNote: Query completion only shows queries from your current connection. Use squix switch <connection> to change connections.
Currently unreleased, build from source to make this available
To run containerized test database servers for all supported databases, use the sister project dbeesly
Save, organize, and execute your SQL queries with ease.
# Add queries with auto-incrementing IDs
squix add daily_report "SELECT * FROM sales WHERE date = CURRENT_DATE"
squix add user_count "SELECT COUNT(*) FROM users"
squix add employees "SELECT TOP 10 * FROM employees ORDER BY last_name"
# Add parameterized queries with :param|default syntax
squix add emp_by_salary "SELECT * FROM employees WHERE salary > :min_sal|30000"
squix add search_users "SELECT * FROM users WHERE name LIKE :name|P% AND status = :status|active"
# When creating queries with params and not default, squix will prompt you for the param value every time you run the query
squix add search_by_name "SELECT * FROM employees where first_name = :name"
# Run parameterized queries with named parameters (order doesn't matter!)
squix run emp_by_salary --min_sal 50000
squix run search_users --name Michael --status active
# Or use positional args (must match SQL order)
squix run search_users Michael active
# List all saved queries
squix list queries
# Search for specific queries
squix list queries emp # Finds queries with 'emp' in name or SQL
squix list queries employees --oneline # displays each query in one line
# Run by name or ID
squix run daily_report
squix run 2
# Edit query before running (great for testing parameter values)
squix run emp_by_salary --edit
Navigate query results with Vim-style keybindings, update cells in-place, delete rows and copy data
Key Features:
- Syntax-highlighted SQL display
- Column type indicators
- Primary key markers
- Live cell editing
- Visual selection mode
Manage multiple database connections and switch between them instantly.
# List all connections
squix list connections
squix switch productionDisplay current connection and check if it is reachable
squix status
Explore your database schema and visualize relationships between tables.
# List all tables and views in multi-column format
squix explore
# Query a table directly
squix explore employees --limit 100
# Visualize foreign key relationships
squix explain employees
squix explain employees --depth 2 # Show relationships 2 levels deep
Note: The squix explain command is currently a work in progress and may change in future versions.
Squix uses your $EDITOR environment variable for editing queries and UPDATE/DELETE statements.
# Set your preferred editor (example in bash)
export EDITOR=vim
export EDITOR=nano
export EDITOR=codeYou can also use the editor to edit queries before running them
# Edit existing query before running
squix run daily_report --edit
# Create and run a new query on the fly
squix run
# Re-run the last executed query
squix run --last
# Edit all queries at once
squix edit queries| Command | Description | Example |
|---|---|---|
create <name> <type> <conn-string> [schema] |
Create new database connection | squix create mydb postgres "postgresql://..." |
switch <name> |
Switch to a different connection | squix switch production |
status |
Show current active connection | squix status |
list connections |
List all configured connections | squix list connections |
| Command | Description | Example |
|---|---|---|
add <name> [sql] |
Add a new saved query | squix add users "SELECT * FROM users" |
remove <name|id> |
Remove a saved query | squix remove users or squix remove 3 |
list queries |
List all saved queries | squix list queries |
list queries --oneline |
lists each query in one line | squix list -o |
list queries <searchterm> |
lists queries containing search term | squix list employees |
run <name|id|sql> |
Execute a query | squix run users or squix run 2 |
run |
Create and run a new query | squix run |
run --edit |
Edit query before running | squix run users --edit |
run --last, -l |
Re-run last executed query | squix run --last |
run --param |
run with named params | squix run --name Squix |
| Command | Description | Example |
|---|---|---|
explore |
List all tables and views in multi-column format | squix explore |
explore <table> [-l N] |
Query a table with optional row limit | squix explore employees --limit 100 |
explain <table> [-d N] [-c] |
Visualize foreign key relationships | squix explain employees --depth 2 |
| Command | Description | Example |
|---|---|---|
info tables |
List all tables from current schema | squix info tables |
info views |
List all views from current schema | squix info views |
| Command | Description | Example |
|---|---|---|
config |
Edit main configuration file | squix config |
edit |
Edit all queries for current connection | squix edit |
edit <name|id> |
Edit a single named query | squix edit 3 |
help [command] |
Show help information | squix help run |
When viewing query results in the TUI, you have full Vim-style navigation and editing capabilities.
| Key | Action |
|---|---|
h, ← |
Move left |
j, ↓ |
Move down |
k, ↑ |
Move up |
l, → |
Move right |
g |
Jump to first row |
G |
Jump to last row |
0, _, Home |
Jump to first column |
$, End |
Jump to last column |
Ctrl+u, PgUp |
Page up |
Ctrl+d, PgDown |
Page down |
| Key | Action |
|---|---|
v |
Enter visual selection mode |
y |
Copy selected cell(s) to clipboard |
Enter |
Show cell value in detail view (with JSON formatting) |
u |
Update current cell (opens editor) |
D |
Delete current row (requires WHERE clause) |
e |
Edit and re-run query |
s |
Save current query |
? |
Toggle keybindings help in footer |
q, Ctrl+c, Esc |
Quit table view |
| Key | Action |
|---|---|
/ |
Search cell content |
n |
Jump to next cell match |
N |
Jump to previous cell match |
f |
Search column headers |
; |
Jump to next column match |
, |
Jump to previous column match |
Press Enter on any cell to open a detailed view that shows the full cell content. If the content is valid JSON, it will be automatically formatted with proper indentation.
In Detail View:
| Key | Action |
|---|---|
↑, ↓, j, k |
Scroll through content |
e |
Edit cell content (opens editor with formatted JSON) |
q, Esc, Enter |
Close detail view |
When you press e in detail view:
- The editor opens with the full content (JSON will be formatted)
- Edit the content as needed
- Save and close to update the database
- JSON validation is performed automatically
- The table view updates with the new value
Press v to enter visual mode, then navigate to select a range of cells.
Press y to copy the selection as plain text, or x to export the selected data as csv, tsv, json, sql insert statement, markdown or html
The copied or exported data will be available in your clipboard
This project is currently in beta, please report unexpected behavior through the issues tab
- Edit command overhaul
- Delete connections with remove command
- Full project rename
- Shell autocomplete (bash, fish, zsh)
- Cell search (
/) and column header search (f) - Encryption on connection username/password in config file
- Dynamic column width
- Duckdb support
- Update to bubbletea v2
We welcome contributions! Get started with detailed instructions from CONTRIBUTING.md
Thanks a lot to all the contributors:
Squix wouldn't exist without the inspiration and groundwork laid by these fantastic projects:
- naggie/dstask - For the elegant CLI design patterns and file-based data storage approach
- DeprecatedLuar/better-curl-saul - For demonstrating a simple and genius approach to making a CLI tool
- dbeaver - The OG database management tool
Built with:
- Bubble Tea - The TUI framework
- Go standard library and various database drivers
MIT License - see LICENSE file for details
Made with 🐿️ by @eduardofuncao
Previously Pam's Database Drawer, thanks to u/marrsd for suggesting the new name!


