Skip to content

Commit e72f649

Browse files
Add tview (#240)
* 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]>
1 parent a729369 commit e72f649

21 files changed

+614
-1340
lines changed

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Use "dblab [command] --help" for more information about a command.
123123
## Usage
124124

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

128128

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

189189
```sh
190190
# default: test
191-
$ dbladb --config
191+
$ dblab --config
192192

193193
$ dblab --config --cfg-name "prod"
194194
```
@@ -273,7 +273,7 @@ Key | Description
273273
<kbd>Ctrl+Space</kbd> | If the query panel is active, execute the query
274274
<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
275275
<kbd>Ctrl+S</kbd> | If the rows panel is active, switch to the schema panel. The opposite is true
276-
<kbd>Ctrl+F</kbd> | If the rows panel is active, switch to the constraints view. The opposite is true
276+
<kbd>Ctrl+T</kbd> | If the rows panel is active, switch to the constraints view. The opposite is true
277277
<kbd>Ctrl+I</kbd> | If the rows panel is active, switch to the indexes view. The opposite is true
278278
<kbd>Ctrl+H</kbd> | Toggle to the panel on the left
279279
<kbd>Ctrl+J</kbd> | Toggle to the panel below

Diff for: cmd/root.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"github.com/danvergara/gocui"
54
"github.com/spf13/cobra"
65

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

95-
gcui, err := gocui.NewGui(gocui.OutputNormal)
96-
if err != nil {
97-
return err
98-
}
99-
100-
app, err := app.New(gcui, opts)
94+
app, err := app.New(opts)
10195
if err != nil {
10296
return err
10397
}

Diff for: go.mod

+9-11
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ require (
99
github.com/charmbracelet/bubbletea v0.21.0
1010
github.com/charmbracelet/lipgloss v0.5.0
1111
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
12-
github.com/danvergara/gocui v0.6.0
13-
github.com/fatih/color v1.13.0
12+
github.com/gdamore/tcell/v2 v2.7.1
1413
github.com/go-sql-driver/mysql v1.6.0
1514
github.com/golang-migrate/migrate/v4 v4.15.2
1615
github.com/google/go-cmp v0.5.9
@@ -19,11 +18,10 @@ require (
1918
github.com/lib/pq v1.10.6
2019
github.com/microsoft/go-mssqldb v1.7.2
2120
github.com/muesli/termenv v0.12.0
22-
github.com/olekukonko/tablewriter v0.0.5
21+
github.com/rivo/tview v0.0.0-20241016194538-c5e4fb24af13
2322
github.com/sijms/go-ora/v2 v2.8.19
2423
github.com/spf13/cobra v1.4.0
2524
github.com/stretchr/testify v1.8.4
26-
golang.org/x/text v0.14.0
2725
modernc.org/sqlite v1.22.1
2826
)
2927

@@ -38,6 +36,7 @@ require (
3836
github.com/davecgh/go-spew v1.1.1 // indirect
3937
github.com/denisenkom/go-mssqldb v0.10.0 // indirect
4038
github.com/dustin/go-humanize v1.0.1 // indirect
39+
github.com/gdamore/encoding v1.0.0 // indirect
4140
github.com/golang-jwt/jwt/v4 v4.1.0 // indirect
4241
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
4342
github.com/golang-sql/sqlexp v0.1.0 // indirect
@@ -49,25 +48,24 @@ require (
4948
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
5049
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
5150
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
52-
github.com/mattn/go-colorable v0.1.12 // indirect
53-
github.com/mattn/go-isatty v0.0.16 // indirect
54-
github.com/mattn/go-runewidth v0.0.13 // indirect
51+
github.com/mattn/go-isatty v0.0.20 // indirect
52+
github.com/mattn/go-runewidth v0.0.15 // indirect
5553
github.com/mattn/go-sqlite3 v1.14.16 // indirect
5654
github.com/mitchellh/mapstructure v1.5.0 // indirect
5755
github.com/muesli/ansi v0.0.0-20211031195517-c9f0611b6c70 // indirect
5856
github.com/muesli/cancelreader v0.2.0 // indirect
5957
github.com/muesli/reflow v0.3.0 // indirect
60-
github.com/nsf/termbox-go v1.1.1 // indirect
6158
github.com/pelletier/go-toml v1.9.5 // indirect
6259
github.com/pmezard/go-difflib v1.0.0 // indirect
6360
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
64-
github.com/rivo/uniseg v0.2.0 // indirect
61+
github.com/rivo/uniseg v0.4.7 // indirect
6562
github.com/spf13/pflag v1.0.5 // indirect
6663
go.uber.org/atomic v1.9.0 // indirect
6764
golang.org/x/crypto v0.18.0 // indirect
6865
golang.org/x/mod v0.8.0 // indirect
69-
golang.org/x/sys v0.16.0 // indirect
70-
golang.org/x/term v0.16.0 // indirect
66+
golang.org/x/sys v0.25.0 // indirect
67+
golang.org/x/term v0.17.0 // indirect
68+
golang.org/x/text v0.14.0 // indirect
7169
golang.org/x/tools v0.6.0 // indirect
7270
gopkg.in/yaml.v2 v2.4.0 // indirect
7371
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)