Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgerojas26/lazysql
A cross-platform TUI database management tool written in Go.
https://github.com/jorgerojas26/lazysql
Last synced: 4 months ago
JSON representation
A cross-platform TUI database management tool written in Go.
- Host: GitHub
- URL: https://github.com/jorgerojas26/lazysql
- Owner: jorgerojas26
- License: mit
- Created: 2023-05-29T05:00:33.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-27T15:14:02.000Z (4 months ago)
- Last Synced: 2024-10-27T16:59:43.078Z (4 months ago)
- Language: Go
- Homepage:
- Size: 1.27 MB
- Stars: 805
- Watchers: 15
- Forks: 39
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-tuis - lazysql - platform TUI database management tool written in Go. (Table of Contents)
README
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
[![LinkedIn][linkedin-shield]][linkedin-url]
LAZYSQL
A cross-platform TUI database management tool written in Go.
Table of Contents
About The Project
- Features
Getting Started
- Usage
- Keybindings
- Roadmap
- Contributing
- License
- Contact
- Acknowledgments
## About The Project
![Product Name Screen Shot][product-screenshot1]
![Product Name Screen Shot][product-screenshot2]This project is heavily inspired by [Lazygit](https://github.com/jesseduffield/lazygit), which I think is the best TUI client for Git.
I wanted to have a tool like that, but for SQL. I didn't find one that fits my needs, so I created one myself.
I live in the terminal, so if you are like me, this tool can become handy for you too.
This is my first Open Source project, also, this is my first Go project. I am not a brilliant programmer. I am just a typical JavaScript developer that wanted to learn a new language, I also wanted a TUI SQL Client, so white and bottled.
This project is in ALPHA stage, please feel free to complain about my spaghetti code.
I use Lazysql daily in my full-time job as a full-stack javascript developer in its current (buggy xD) state. So, the plan is to improve and fix my little boy as a side-project in my free time.
### Built With
![Golang][golang-shield]
![Golang][tview-shield]## Features
- [x] Cross-platform (macOS, Windows, Linux)
- [x] Vim Keybindings
- [x] Can manage multiple connections (Backspace)
- [x] Tabs
- [x] SQL Editor (CTRL + e)## Getting Started
### Installation
#### Homebrew
```bash
brew tap jorgerojas26/lazysql
brew install lazysql
```#### Install with go package manager
```bash
go install github.com/jorgerojas26/lazysql@latest
```#### Binary Releases
For Windows, macOS or Linux, you can download a binary release [here](https://github.com/jorgerojas26/lazysql/releases)
#### Third party (maintained by the community)
Arch Linux users can install it from the AUR with:
```bash
paru -S lazysql```
or
```bash
yay -S lazysql```
or install it manual with:
```bash
git clone https://aur.archlinux.org/lazysql.git
cd lazysql
makepkg -si
```## Usage
```bash
$ lazysql
```## Support
- [x] MySQL
- [x] PostgreSQL
- [x] SQLite
- [ ] MSSQL
- [ ] MongoDBSupport for multiple RDBMS is a work in progress.
## Keybindings
### Global
| Key | Action |
| --------- | ------------------------------ |
| q | Quit |
| CTRL + e | Open SQL editor |
| Backspace | Return to connection selection |
| ? | Show keybindings popup |### Table
| Key | Action |
| -------- | ------------------------------------ |
| c | Edit table cell |
| d | Delete row |
| o | Add row |
| / | Focus the filter input or SQL editor |
| CTRL + s | Commit changes |
| > | Next page |
| < | Previous page |
| K | Sort ASC |
| J | Sort DESC |
| H | Focus tree panel |
| [ | Focus previous tab |
| ] | Focus next tab |
| X | Close current tab |
| R | Refresh the current table |### Tree
| Key | Action |
| --- | ------------------------------ |
| L | Focus table panel |
| G | Focus last database tree node |
| g | Focus first database tree node |### SQL Editor
| Key | Action |
| ------------ | --------------------------------- |
| CTRL + R | Run the SQL statement |
| CTRL + Space | Open external editor (Linux only) |Specific editor for lazysql can be set by `$SQL_EDITOR`.
Specific terminal for opening editor can be set by `$SQL_TERMINAL`
## Example connection URLs
```
postgres://user:pass@localhost/dbname
pg://user:pass@localhost/dbname?sslmode=disable
mysql://user:pass@localhost/dbname
mysql:/var/run/mysqld/mysqld.sock
sqlserver://user:[email protected]/dbname
mssql://user:[email protected]/instance/dbname
ms://user:[email protected]:port/instance/dbname?keepAlive=10
oracle://user:[email protected]/sid
sap://user:pass@localhost/dbname
file:myfile.sqlite3?loc=auto
/path/to/sqlite/file/test.db
odbc+postgres://user:pass@localhost:port/dbname?option1=
```## Roadmap
- [ ] Support for NoSQL databases
- [ ] Columns and indexes creation through TUI
- [x] Table tree input filter
- [ ] Custom keybindings
- [x] Show keybindings on a modal
- [x] Rewrite row `create`, `update` and `delete` logicSee the [open issues](https://github.com/jorgerojas26/lazysql/issues) for a full list of proposed features (and known issues).
## Clipboard support
We use [atotto/clipboard](https://github.com/atotto/clipboard?tab=readme-ov-file#clipboard-for-go) to copy to clipboard.
Platforms:
- OSX
- Windows 7 (probably work on other Windows)
- Linux, Unix (requires 'xclip' or 'xsel' command to be installed)## Contributing
Contributions, issues, and pull requests are welcome!
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
## Contact
Jorge Rojas - [LinkedIn](https://www.linkedin.com/in/jorgerojas26/) - [email protected]
## Alternatives
- [Mitzasql](https://github.com/vladbalmos/mitzasql)
- [Gobang](https://github.com/TaKO8Ki/gobang)[contributors-shield]: https://img.shields.io/github/contributors/jorgerojas26/lazysql?style=for-the-badge
[contributors-url]: https://github.com/jorgerojas26/lazysql/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/jorgerojas26/lazysql?style=for-the-badge
[forks-url]: https://github.com/jorgerojas26/lazysql/network/members
[stars-shield]: https://img.shields.io/github/stars/jorgerojas26/lazysql?style=for-the-badge
[stars-url]: https://github.com/jorgerojas26/lazysql/stargazers
[issues-shield]: https://img.shields.io/github/issues/jorgerojas26/lazysql?style=for-the-badge
[issues-url]: https://github.com/jorgerojas26/lazysql/issues
[license-shield]: https://img.shields.io/github/license/jorgerojas26/lazysql.svg?style=for-the-badge
[license-url]: https://github.com/jorgerojas26/lazysql/blob/main/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/jorgerojas26
[product-screenshot1]: images/lazysql-connection-selection.png
[product-screenshot2]: images/lazysql.png
[golang-shield]: https://img.shields.io/badge/Golang-gray?style=for-the-badge&logo=go
[tview-shield]: https://img.shields.io/badge/tview-gray?style=for-the-badge&logo=go