### **SQL Query Stashing for Terminal Squirrels**
> **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."
---
[](LICENSE)

[](https://matrix.to/#/#squix-sql:matrix.org)
[](https://github.com/sponsors/eduardofuncao)
**A minimal CLI tool for managing and executing SQL queries across multiple databases. Written in Go, made beautiful with BubbleTea**
[Quick Start](#--------quick-start) • [Configuration](docs/configuration.md) • [Commands](docs/commands.md) • [Keybindings](docs/keybindings.md) • [Features](docs/features.md) • [Completion](docs/completion.md) • [Databases](docs/databases.md) • [Roadmap](#--------roadmap) • [Contributing](CONTRIBUTING.md)
> This project is currently in beta, please report unexpected behavior through the issues tab
---
Demo

> Try out the [live demo](https://squix.live.eduardofuncao.com) (no install required!)
### Highlights
- **Query Library** - Save and organize your most-used queries, with parameterized support
- **Multi-Database** - Works with PostgreSQL, MySQL, SQLite, Oracle, SQL Server, ClickHouse, Firebird and DuckDB
- **Table view TUI** - Keyboard focused navigation and search with configurable 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
- **Connection Switching** - Manage multiple databases and switch instantly
- **Database Exploration** - Browse schema, visualize foreign key relationships
- **Interactive Shell** - REPL with history, multi-line, and meta-commands
See [Features](docs/features.md) for details and examples
---
Quick Start
### Installation
Go to [the releases page](https://github.com/eduardofuncao/squix/releases) 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
```bash
go install github.com/eduardofuncao/squix/cmd/squix@latest
```
this will put the binary `squix` in your $GOBIN path (usually `~/go/bin`)
Build Manually
Follow these instructions to build the project locally
```bash
git clone https://github.com/eduardofuncao/squix
go build -o squix ./cmd/squix
```
The squix binary will be available in the root project directory
DuckDB requires CGO and is included in the default build. To build without DuckDB:
```bash
CGO_ENABLED=0 go build -o squix ./cmd/squix
```
Nixpkgs
Squix is available in [nixpkgs](https://search.nixos.org/packages?query=squix) (v0.4.0-beta+).
```bash
# Try it
nix-shell -p squix
# Or with flakes
nix run nixpkgs#squix
```
Nix / NixOS (Flake)
Squix is available as a Nix flake for easy installation on NixOS and systems with
Nix.
#### Run directly without installing
```bash
nix run github:eduardofuncao/squix
```
#### Install to user profile
```bash
nix profile install github:eduardofuncao/squix
```
#### Enter development shell
```bash
nix develop github:eduardofuncao/squix
```
#### NixOS System-wide
Add to your flake-based configuration.nix or flake.nix:
```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
#### Home Manager
Add to your home.nix or flake config:
```nix
{
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
Homebrew
```bash
brew tap eduardofuncao/squix
brew install squix
```
Arch (AUR) - Unofficial
There's also an unofficial AUR package for squix available at: [squix-bin](https://aur.archlinux.org/packages/squix-bin)
### Basic Usage
```bash
# 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"
```
### Navigating the Table
Once your query results appear, you can navigate and interact with the data:
```bash
# 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
# Search around
/ # Search cell's contents (n/N to cycle through results)
f # Search column names (,/; to cycle through results)
# Help
H # Show keyboard shortcuts overlay
? # Toggle footer keybinds
# Exit
q # Quit back to terminal
```
---
Database Support
PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, Oracle, ClickHouse, Firebird, DuckDB
See connection init examples in [Database Support](docs/databases.md)
---
Shell Completion
Dynamic tab completion for bash, zsh, and fish that includes your saved queries and connections.
See [Shell Completion](docs/completion.md)
---
Configuration
Row limits, column widths, color schemes (`dracula`, `gruvbox`, `catppuccin-mocha`, etc.) and UI visibility options can be set through the config file at `~/.config/squix/config.yaml`.
See [Configuration](docs/configuration.md)
---
All Commands
See [Commands](docs/commands.md) for the full command reference and database init examples
---
TUI Table Navigation
See [Keybindings](docs/keybindings.md) for all navigation, editing, search, and visual mode keybindings on the results table view
---
For Robots
Squix ships a `SKILL.md` file in the repo root, a simple reference for AI
coding agents (Claude Code, Copilot, etc.) to use squix non-interactively. It
covers safe commands, format flags, parameterized queries, and which commands
to avoid (TUI/editor). Point your agent at it if you want it to run SQL queries
as part of your workflow.
---
Roadmap
> This project is currently in beta, please report unexpected behavior through the issues tab
### v0.3.0 - Squix 🐿️
- [x] Edit command overhaul
- [x] Delete connections with remove command
- [x] Full project rename
### v0.4.0 - Acorn 🌰
- [x] Interactive query shell (`squix shell`)
- [x] Shell autocomplete (bash, fish, zsh)
- [x] Cell search (`/`) and column header search (`f`)
- [x] Add skill file for ai agents and non interactive query results
- [x] Option to return results from `squix run` as json, csv, etc. with `--format` flag
- [x] Duckdb support
### v0.5.0 - Scrat 🧊
- [x] Configurable keybinds
- [x] Migrate to bubbletea v2
- [x] Return more info on exec statements (insert, update, delete, etc.)
- [x] Homebrew custom tap
- [x] nixpkgs entry
- [x] Handle windows env vars seamlessly
- [ ] More options to encrypt data in the config file
---
Sponsor
If Squix saves you time, consider supporting its development through [GitHub
Sponsors](https://github.com/sponsors/eduardofuncao). I work on Squix in my
spare time and your support helps me dedicate more hours to it, keep the [live
demo](https://squix.live.eduardofuncao.com) running, build a proper
docs/landing site, and cover GitHub Actions minutes for cross-platform builds,
instead of relying on local builds.
Any amount is greatly appreciated ❤
---
Contributing & acknowledgements
We welcome contributions! Get started with detailed instructions from [CONTRIBUTING.md](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](https://github.com/naggie/dstask)** - For the elegant CLI design patterns and file-based data storage approach
- **[DeprecatedLuar/better-curl-saul](https://github.com/DeprecatedLuar/better-curl-saul)** - For demonstrating a simple and genius approach to making a CLI tool
- **[dbeaver](https://github.com/dbeaver/dbeaver)** - The OG database management tool
Built with:
- [Bubble Tea](https://github.com/charmbracelet/bubbletea) - The TUI framework
- Go standard library and various database drivers
**Made with 🐿️ by [@eduardofuncao](https://github.com/eduardofuncao)**
Previously Pam's Database Drawer, thanks to [u/marrsd](https://www.reddit.com/user/marrsd/) for suggesting the new name!