Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xxf098/gobangx

A cross-platform Vim-like database management tool written in Rust
https://github.com/xxf098/gobangx

database rust sql terminal tui vim

Last synced: 27 days ago
JSON representation

A cross-platform Vim-like database management tool written in Rust

Awesome Lists containing this project

README

        

gobangx is based on [gobang](https://github.com/TaKO8Ki/gobang)

A cross-platform Vim-like database management tool written in Rust

[![github workflow status](https://img.shields.io/github/workflow/status/xxf098/gobangx/CI/main)](https://github.com/xxf098/gobangx/actions)

## Features

- Cross-platform support (macOS, Windows, Linux)
- Multiple Database support (MySQL, PostgreSQL, SQLite)
- Intuitive keyboard only control

## Installation

### From binaries (Linux, macOS, Windows)

- Download the [latest release binary](https://github.com/xxf098/gobangx/releases) for your system
- Set the `PATH` environment variable

## Usage

```
$ gobang
```

```
$ gobang -h
USAGE:
gobang [OPTIONS]

FLAGS:
-h, --help Prints help information
-V, --version Prints version information

OPTIONS:
-c, --config-path Set the config file
```

If you want to add connections, you need to edit your config file. For more information, please see [Configuration](#Configuration).

## Keymap

| Key | Description |
| ---- | ---- |
| h, j, k, l | Scroll left/down/up/right |
| Ctrl + u, Ctrl + d | Scroll up/down multiple lines |
| 0, $ | Scroll to start/end |
| g , G | Scroll to top/bottom |
| f+_ | Forward to next column starts with the character `_` |
| F+_ | Backward to next column starts with the character `_` |
| ; | Repeat previous f, F movement |
| H, J, K, L | Extend selection by one cell left/down/up/right |
| y | Yank a cell value |
| yc | Yank column name |
| Y | Yank `CREATE TABLE` or `INSERT INTO` sql |
| D | Delete row by primary key or `id` or first column |
| C | Change current cell value, set value to `NULL` with `` |
| : | Start ex command, see below for commands list |
| o, O | Order column asc/desc |
| =, - | Expand/Shorten column width |
| , | Move focus to left/right |
| c | Move focus to connections |
| r | Move focus to recent tables |
| / | Filter |
| ? | Help |
| 1, 2, 3, 4, 5 | Switch to records/columns/constraints/foreign keys/indexes tab |

## Command
| Command | Description |
| ---- | ---- |
| tree | Toggle database tree |

## Configuration

The location of the file depends on your OS:

- macOS: `$HOME/.config/gobang/config.toml`
- Linux: `$HOME/.config/gobang/config.toml`
- Windows: `%APPDATA%/gobang/config.toml`

The following is a sample config.toml file:

```toml
[[conn]]
type = "mysql"
user = "root"
host = "localhost"
port = 3306

[[conn]]
type = "mysql"
user = "root"
host = "localhost"
port = 3306
password = "password"
database = "foo"

[[conn]]
type = "postgres"
user = "root"
host = "localhost"
port = 5432
database = "bar"

[[conn]]
type = "sqlite"
path = "/path/to/baz.db"

[settings]
# support: red,green,yellow,blue,magenta,cyan or color code
color = "red"
# page size limit, page_size >= 20 && page_size <= 2000
page_size = 100
```