Home

Awesome

<a name="readme-top"></a>

Contributors Forks Stargazers Issues MIT License LinkedIn

<!-- PROJECT LOGO --> <div align="center"> <!-- <a href="https://github.com/jorgerojas26/lazysql"> --> <!-- <img src="images/logo.png" alt="Logo" width="80" height="80"> --> <!-- </a> --> <h3 align="center">LAZYSQL</h3> <p align="center"> A cross-platform TUI database management tool written in Go. </p> </div> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li><a href="#features">Features</a></li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#installation">Installation</a></li> </ul> </li> <li><a href="#usage">Usage</a></li> <li><a href="#keybindings">Keybindings</a></li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgments">Acknowledgments</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

Product Name Screen Shot Product Name Screen Shot

This project is heavily inspired by 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

Features

<!-- GETTING STARTED -->

Getting Started

Installation

Homebrew

brew tap jorgerojas26/lazysql
brew install lazysql

Install with go package manager

go install github.com/jorgerojas26/lazysql@latest

Binary Releases

For Windows, macOS or Linux, you can download a binary release here

Third party (maintained by the community)

Arch Linux users can install it from the AUR with:

paru -S lazysql

or

yay -S lazysql

or install it manual with:

git clone https://aur.archlinux.org/lazysql.git
cd lazysql
makepkg -si
<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- USAGE EXAMPLES -->

Usage

$ lazysql
<p align="right">(<a href="#readme-top">back to top</a>)</p>

Support

Support for multiple RDBMS is a work in progress.

Keybindings

Global

KeyAction
qQuit
CTRL + eOpen SQL editor
BackspaceReturn to connection selection
?Show keybindings popup

Table

KeyAction
cEdit table cell
dDelete row
oAdd row
/Focus the filter input or SQL editor
CTRL + sCommit changes
>Next page
<Previous page
KSort ASC
JSort DESC
HFocus tree panel
[Focus previous tab
]Focus next tab
XClose current tab

Tree

KeyAction
LFocus table panel
GFocus last database tree node
gFocus first database tree node

SQL Editor

KeyAction
CTRL + RRun the SQL statement
CTRL + SpaceOpen 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:pass@remote-host.com/dbname
mssql://user:pass@remote-host.com/instance/dbname
ms://user:pass@remote-host.com:port/instance/dbname?keepAlive=10
oracle://user:pass@somehost.com/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 -->

Roadmap

See the open issues for a full list of proposed features (and known issues).

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Clipboard support

We use atotto/clipboard to copy to clipboard.

Platforms:

<!-- CONTRIBUTING -->

Contributing

Contributions, issues, and pull requests are welcome!

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE.txt for more information.

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- CONTACT -->

Contact

Jorge Rojas - LinkedIn - jorgeluisrojasb@gmail.com

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Alternatives

<p align="right">(<a href="#readme-top">back to top</a>)</p> <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->