Skip to content

Commit

Permalink
Add tview (#240)
Browse files Browse the repository at this point in the history
* build(gomod): install tview

* feat(tui): add a new tui package that uses tview replacing the gui package

* feat(app): replace the the gui dependency with tui in the app

* feat(tui): add query text view and interaction between metadata tables

* feat(tui): add vim like navigation

* build(gomod): update deps

* feat(tui): complete current functionality usint tview on tui pkg

* refactor(tui): refactor the tui's package code

* refactor(gui): remove the gui pkg and the gocui library from the project

* docs(readme): update a key binding in the readme file

* docs(screenshots): replace the screenshots with new ones

* docs(demo-gif): update the gif with the new version (#241)

* docs(demo-gif): update the gif with the new version

* docs(typo): fix a typo

* add local file

* fix url

* remove old gif

---------

Co-authored-by: Thiago Mowszet <[email protected]>
  • Loading branch information
danvergara and ThiagoMowszet authored Nov 4, 2024
1 parent a729369 commit e72f649
Show file tree
Hide file tree
Showing 21 changed files with 614 additions and 1,340 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Use "dblab [command] --help" for more information about a command.
## Usage

You can start the app passing no flags or parameters, you'll be asked for connection data instead.
![Alt Text](screenshots/dblab-default-form.gif)
![dblab-demo](screenshots/dblab-demo.gif)


```sh
Expand Down Expand Up @@ -188,7 +188,7 @@ As of `v0.21.0`, ssl connections options are supported in the config file.

```sh
# default: test
$ dbladb --config
$ dblab --config

$ dblab --config --cfg-name "prod"
```
Expand Down Expand Up @@ -273,7 +273,7 @@ Key | Description
<kbd>Ctrl+Space</kbd> | If the query panel is active, execute the query
<kbd>Enter</kbd> | If the tables panel is active, list all the rows as a result set on the rows panel and display the structure of the table on the structure panel
<kbd>Ctrl+S</kbd> | If the rows panel is active, switch to the schema panel. The opposite is true
<kbd>Ctrl+F</kbd> | If the rows panel is active, switch to the constraints view. The opposite is true
<kbd>Ctrl+T</kbd> | If the rows panel is active, switch to the constraints view. The opposite is true
<kbd>Ctrl+I</kbd> | If the rows panel is active, switch to the indexes view. The opposite is true
<kbd>Ctrl+H</kbd> | Toggle to the panel on the left
<kbd>Ctrl+J</kbd> | Toggle to the panel below
Expand Down
8 changes: 1 addition & 7 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"github.com/danvergara/gocui"
"github.com/spf13/cobra"

"github.com/danvergara/dblab/pkg/app"
Expand Down Expand Up @@ -92,12 +91,7 @@ func NewRootCmd() *cobra.Command {
return err
}

gcui, err := gocui.NewGui(gocui.OutputNormal)
if err != nil {
return err
}

app, err := app.New(gcui, opts)
app, err := app.New(opts)
if err != nil {
return err
}
Expand Down
20 changes: 9 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ require (
github.com/charmbracelet/bubbletea v0.21.0
github.com/charmbracelet/lipgloss v0.5.0
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
github.com/danvergara/gocui v0.6.0
github.com/fatih/color v1.13.0
github.com/gdamore/tcell/v2 v2.7.1
github.com/go-sql-driver/mysql v1.6.0
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/google/go-cmp v0.5.9
Expand All @@ -19,11 +18,10 @@ require (
github.com/lib/pq v1.10.6
github.com/microsoft/go-mssqldb v1.7.2
github.com/muesli/termenv v0.12.0
github.com/olekukonko/tablewriter v0.0.5
github.com/rivo/tview v0.0.0-20241016194538-c5e4fb24af13
github.com/sijms/go-ora/v2 v2.8.19
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.8.4
golang.org/x/text v0.14.0
modernc.org/sqlite v1.22.1
)

Expand All @@ -38,6 +36,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.10.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/gdamore/encoding v1.0.0 // indirect
github.com/golang-jwt/jwt/v4 v4.1.0 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
Expand All @@ -49,25 +48,24 @@ require (
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-sqlite3 v1.14.16 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
github.com/muesli/cancelreader v0.2.0 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/nsf/termbox-go v1.1.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit e72f649

Please sign in to comment.