|
| 1 | +# sqlit |
| 2 | + |
| 3 | +A simple terminal UI for SQL Server, for those who just want to run some queries. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +<!--  --> |
| 9 | + |
| 10 | +You know that mass of software that is SSMS? You open it up and wait... and wait... just to run a simple SELECT query. Meanwhile it's eating up your RAM like there's no tomorrow. |
| 11 | + |
| 12 | +And if you're on Linux? Your only option has been a VS Code extension. Seriously? |
| 13 | + |
| 14 | +All you want is to connect to a database, browse some tables, and run a query. That's it. You don't need the 47 features you've never touched. |
| 15 | + |
| 16 | +sqlit is a lightweight SQL Server client that shows you what you can do at all times. No memorizing keybindings. No digging through menus. Just connect and query. |
| 17 | + |
| 18 | +## Features |
| 19 | + |
| 20 | +- Browse databases, tables, views, and stored procedures |
| 21 | +- Execute SQL queries with syntax highlighting |
| 22 | +- Vim-style modal editing (because you're in a terminal) |
| 23 | +- SQL autocomplete for tables, columns, and procedures |
| 24 | +- Multiple authentication methods (Windows, SQL Server, Entra ID) |
| 25 | +- Save and manage connections |
| 26 | +- CLI mode for scripting and AI agents |
| 27 | +- Themes (Tokyo Night, Nord, and more) |
| 28 | +- Auto-detects and installs ODBC drivers |
| 29 | + |
| 30 | +## Installation |
| 31 | + |
| 32 | +```bash |
| 33 | +pip install sqlit-tui |
| 34 | +``` |
| 35 | + |
| 36 | +That's it. When you first run sqlit, it will detect if you're missing ODBC drivers and help you install them for your OS (Ubuntu, Fedora, Arch, macOS, etc). |
| 37 | + |
| 38 | +## Usage |
| 39 | + |
| 40 | +```bash |
| 41 | +sqlit |
| 42 | +``` |
| 43 | + |
| 44 | +The keybindings are shown at the bottom of the screen. |
| 45 | + |
| 46 | +### CLI |
| 47 | + |
| 48 | +```bash |
| 49 | +# Run a query |
| 50 | +sqlit query -c "MyServer" -q "SELECT * FROM Users" |
| 51 | + |
| 52 | +# Output as CSV or JSON |
| 53 | +sqlit query -c "MyServer" -q "SELECT * FROM Users" --format csv |
| 54 | +sqlit query -c "MyServer" -f "script.sql" --format json |
| 55 | + |
| 56 | +# Manage connections |
| 57 | +sqlit connection list |
| 58 | +sqlit connection create --name "MyServer" --server "localhost" --auth-type sql |
| 59 | +sqlit connection delete "MyServer" |
| 60 | +``` |
| 61 | + |
| 62 | +## Keybindings |
| 63 | + |
| 64 | +| Key | Action | |
| 65 | +|-----|--------| |
| 66 | +| `i` | Enter INSERT mode | |
| 67 | +| `Esc` | Back to NORMAL mode | |
| 68 | +| `e` / `q` / `r` | Focus Explorer / Query / Results | |
| 69 | +| `s` | SELECT TOP 100 from table | |
| 70 | +| `Ctrl+P` | Command palette | |
| 71 | +| `Ctrl+Q` | Quit | |
| 72 | +| `?` | Help | |
| 73 | + |
| 74 | +Autocomplete triggers automatically in INSERT mode. Use `Tab` to accept. |
| 75 | + |
| 76 | +You can also receive autocompletion on columns by typing the table name and hitting "." |
| 77 | + |
| 78 | +## Configuration |
| 79 | + |
| 80 | +Connections and settings are stored in `~/.sqlit/`. |
| 81 | + |
| 82 | +## License |
| 83 | + |
| 84 | +MIT |
0 commit comments