Giter Site home page Giter Site logo

danvergara / dblab Goto Github PK

View Code? Open in Web Editor NEW
765.0 765.0 32.0 14.75 MB

The database client every command line junkie deserves.

License: MIT License

Go 93.89% Makefile 2.68% Shell 3.02% Dockerfile 0.42%
cli client developer-tools development golang mysql postgresql tui

dblab's Introduction

Hello! I'm Daniel Vergara

I'm backend developer ๐Ÿค–. Organizer at GophersMX. Core maintainer of dblab

๐Ÿ“ซ How to reach me:

email

๐Ÿ”ฅ My Stats :

GitHub Streak Dan's GitHub stats Top Langs

Experience:

  • BACKEND DEVELOPER (Raincoat | OCT 2022 - )

    • Working on maintaining Go and Python microservices running on top of k8s clusters.--
    • Maintaining a couple ETLS to process client's data asynchronously.
    • Stack: Go, Python, Kubernetes, gRPC, Helm, PostgreSQL, Redis, MongoDB, Nats.
  • BACKEND DEVELOPER (Ardan Labs | MAR 2021 - AUG 2022 )

    • Worked on maintaining Go microservices running on top of k8s clusters.
    • Led the transition from Python (Falcon) to Go (goswagger - sqlx - gRPC - Redis).
    • Stack: Go, go-swagger, Kubernetes, gRPC, PostgreSQL, Redis.
  • BACKEND DEVELOPER (Voxie | SEP 2020 - MAR 2021 )

    • Worked on a Golang gRPC micro-service running on top of a K8s cluster
    • Stack: PHP, Laravel, Golang, gRPC, Kubernetes, Laravel Vapor, AWS
  • BACKEND DEVELOPER (CREDIJUSTO | NOV 2019 - AUG 2020 )

    • Developed and maintained some Flask and Go microservices.
    • Built required infrastructure and CI/CD piplines
    • Stack: Python Flask, Golang, Pulumi, Codefresh/CircleCI and AWS
  • TECH LEAD (TRUEHOME | APR 2019 - NOV 2019)

    • Scraped many websites in order to get real state data
    • Developed serverless applications and some microservices
    • Built CI/CD pipelines and required infrastructure
    • Stack: Python, Flask, Scrapy, Bueautiful Soup, Terraform, AWS Lambdas, PostgreSQL, Gitlab CI and AWS
  • FULLSTACK DEVELOPER (HEXAGON DATA | JUL 2018 - APR 2019)

    • Developed a new product for the company, that allowed to track users' online behavior anonymously
    • Supported the automation of data analysis team
    • Stack: Ruby On Rails, Python, Vue, BigQuery and GCP
  • RUBY ON RAILS DEVELOPER (รRBOL FINANCIERO | AUG 2017 - JUL 2018)

    • Maintained the core platform of the business
    • Developed and maintained an API REST for some clients
    • Stack: Ruby on Rails, CoffeeScript, PostgreSQL and Heroku

๐Ÿค“ Preferred programming languages:

Dancing Gopher

โšก Recent Activity

  1. ๐Ÿ’ช Opened PR #201 in danvergara/dblab
  2. ๐Ÿ—ฃ Commented on #199 in danvergara/dblab
  3. ๐Ÿ—ฃ Commented on #194 in danvergara/dblab
  4. ๐Ÿ”’ Closed issue #194 in danvergara/dblab
  5. ๐Ÿš€ Published release v0.23.0 in danvergara/dblab

dblab's People

Contributors

adasauce avatar danvergara avatar dvaldivia avatar israteneda avatar kianmeng avatar timetravel-1010 avatar valerybriz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dblab's Issues

Unable to connect to mariadb when password contains characters '@#'

Describe the bug
Unable to connect to mariadb when password contains characters '@#'

To Reproduce
Steps to reproduce the behavior:
Connect to mariadb or mysql with a password containing '@#' e.g.

./dblab --driver mysql --host xyz.abc.db.skysql.net --user myuser --pass 5@klkbN#ABC--ssl enable --port 5001

or

./dblab --driver mysql --host xyz.abc.db.skysql.net --user myuser --pass '5@klkbN#ABC'--ssl enable --port 5001

Receive this error:
Error: Error 1045: Access denied for user 'redacted'@'redactedip' (using password: YES)

Expected behavior
Connects

Screenshots
If applicable, add screenshots to help explain your problem.

OS (please complete the following information):

  • MacOS BigSur 11.2.3

CGo-free port of SQLite/SQLite3.

Is your feature request related to a problem? Please describe.
Maintain two kind of executable files with the only goal to support sqlite is not worth it. The reason to do this is that sqlite3 heavily relies on gcc. We need a alternative.

Describe the solution you'd like
Recently a CGo-free port came out and it's starting to do numbers out there. We should replace the current sqlite driver and only maintain one CGO disabled binary.

[FEATURE] multiple "configuration" support

Is your feature request related to a problem? Please describe.
No, not at all.

Describe the solution you'd like
I really like the --config flag and I was wondering if it could be possible to add support for multiple configurations. I think that most developers using this tool have a local database, maybe another local database only used for testing purposes, and then a database for each environment in which the deploy their code.

Describe alternatives you've considered
The alternative is to add all your configurations in the $HOME/.dblab.yaml file and comment them, except the one you're going to use.

Additional context
dblab is a nice tool so thanks a lot for making it.

Error using sqlite without parameters

Describe the bug
When I run the command and select sqlite, I received an error "Error: strconv.Atoi: parsing "": invalid syntax"

To Reproduce
Steps to reproduce the behavior:

  1. Run command dblab
  2. Select sqlite driver
  3. Fill file path with relative path to existent (or unexistent) file path, press enter
  4. Left the limit empty and press enter
  5. Press enter for ssl too

Expected behavior
Connect to database

Screenshots
If applicable, add screenshots to help explain your problem.

OS (please complete the following information):

  • Windows 11

Additional context
Using Windows Command Prompt.

SSL connection related flags for Postgres

Is your feature request related to a problem? Please describe.
When it comes to SSL connection, dblab assumes that you have the default files set in your system (e.g., ~/.postgresql/root.crt) and there's no way to customize this behavior right now.

Describe the solution you'd like
dblab should provide flags like --sslcert, --sslkey and --sslrootcert at least.

Describe alternatives you've considered
Another way to solve would adding a flag that receives a string with custom values like --custom='sslrootcert=/path/to/root.crt'

fatal panic in dblab 0.13.0 when compiled with Go 1.17.3 on x86_64 macOS

Describe the bug
When dblab is compiled with Go 1.17.3 on Darwin on an x86_64 platform, it panics on startup.

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff6c1cf70a]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6c1cf70a
stack: frame={sp:0x7ffeefbff5f8, fp:0x7ffeefbff648} stack=[0x7ffeefb80698,0x7ffeefbff700)
0x00007ffeefbff4f8:  0x01007ffeefbff518  0x0000000000000004 
0x00007ffeefbff508:  0x000000000000001f  0x00007fff6c1cf70a 
0x00007ffeefbff518:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff528:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff538:  0x00000000045fa820  0x00007ffeefbff580 
0x00007ffeefbff548:  0x0000000004038b88 <runtime.fatalthrow.func1+0x0000000000000048>  0x00000000049e3720 
0x00007ffeefbff558:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff568:  0x00007ffeefbff5c8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff578:  0x00000000049e3720  0x00007ffeefbff5b8 
0x00007ffeefbff588:  0x0000000004038b10 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff598 
0x00007ffeefbff598:  0x0000000004038b40 <runtime.fatalthrow.func1+0x0000000000000000>  0x00000000049e3720 
0x00007ffeefbff5a8:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff5b8:  0x00007ffeefbff5e8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff5c8:  0x00007ffeefbff5d0  0x0000000004038900 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff5d8:  0x0000000004601a8b  0x000000000000002a 
0x00007ffeefbff5e8:  0x00007ffeefbff638  0x000000000404e3f6 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff5f8: <0x0000000004601a8b  0x00000000049e3720 
0x00007ffeefbff608:  0x00007ffeefbff678  0x000000000402b666 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff618:  0x000000c00020e000  0x0000000000008000 
0x00007ffeefbff628:  0x00007fff00000008  0x0000000000000000 
0x00007ffeefbff638:  0x00007ffeefbff680 !0x00007fff6c1cf70a 
0x00007ffeefbff648: >0x00007ffeefbff680  0x0000000004938000 
0x00007ffeefbff658:  0x000000000000059a  0x00000000042cd365 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff668:  0x000000000406aa3f <runtime.syscall+0x000000000000001f>  0x000000c0001cb848 
0x00007ffeefbff678:  0x00007ffeefbff6c0  0x000000c0001cb818 
0x00007ffeefbff688:  0x00000000040688b0 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000004 
0x00007ffeefbff698:  0x0000000004018700 <runtime.evacuate_faststr+0x0000000000000220>  0x8700000000001018 
0x00007ffeefbff6a8:  0x0000000000000010  0x0000000004a17e78 
0x00007ffeefbff6b8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff6c8:  0x00000000040669c9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff6d8:  0x0000000004687060  0x00000000049e3720 
0x00007ffeefbff6e8:  0x00007ffeefbff738  0x00000000040668c5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff6f8:  0x000000000406687d <runtime.rt0_go+0x000000000000013d> 
runtime.throw({0x4601a8b, 0x49e3720})
	/opt/macports-test/lib/go/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6c1cf70a
stack: frame={sp:0x7ffeefbff5f8, fp:0x7ffeefbff648} stack=[0x7ffeefb80698,0x7ffeefbff700)
0x00007ffeefbff4f8:  0x01007ffeefbff518  0x0000000000000004 
0x00007ffeefbff508:  0x000000000000001f  0x00007fff6c1cf70a 
0x00007ffeefbff518:  0x0b01dfacedebac1e  0x0000000000000001 
0x00007ffeefbff528:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff538:  0x00000000045fa820  0x00007ffeefbff580 
0x00007ffeefbff548:  0x0000000004038b88 <runtime.fatalthrow.func1+0x0000000000000048>  0x00000000049e3720 
0x00007ffeefbff558:  0x0000000000000001  0x0000000000000001 
0x00007ffeefbff568:  0x00007ffeefbff5c8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff578:  0x00000000049e3720  0x00007ffeefbff5b8 
0x00007ffeefbff588:  0x0000000004038b10 <runtime.fatalthrow+0x0000000000000050>  0x00007ffeefbff598 
0x00007ffeefbff598:  0x0000000004038b40 <runtime.fatalthrow.func1+0x0000000000000000>  0x00000000049e3720 
0x00007ffeefbff5a8:  0x00000000040388d1 <runtime.throw+0x0000000000000071>  0x00007ffeefbff5c8 
0x00007ffeefbff5b8:  0x00007ffeefbff5e8  0x00000000040388d1 <runtime.throw+0x0000000000000071> 
0x00007ffeefbff5c8:  0x00007ffeefbff5d0  0x0000000004038900 <runtime.throw.func1+0x0000000000000000> 
0x00007ffeefbff5d8:  0x0000000004601a8b  0x000000000000002a 
0x00007ffeefbff5e8:  0x00007ffeefbff638  0x000000000404e3f6 <runtime.sigpanic+0x0000000000000396> 
0x00007ffeefbff5f8: <0x0000000004601a8b  0x00000000049e3720 
0x00007ffeefbff608:  0x00007ffeefbff678  0x000000000402b666 <runtime.(*mheap).allocSpan+0x0000000000000546> 
0x00007ffeefbff618:  0x000000c00020e000  0x0000000000008000 
0x00007ffeefbff628:  0x00007fff00000008  0x0000000000000000 
0x00007ffeefbff638:  0x00007ffeefbff680 !0x00007fff6c1cf70a 
0x00007ffeefbff648: >0x00007ffeefbff680  0x0000000004938000 
0x00007ffeefbff658:  0x000000000000059a  0x00000000042cd365 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005> 
0x00007ffeefbff668:  0x000000000406aa3f <runtime.syscall+0x000000000000001f>  0x000000c0001cb848 
0x00007ffeefbff678:  0x00007ffeefbff6c0  0x000000c0001cb818 
0x00007ffeefbff688:  0x00000000040688b0 <runtime.asmcgocall+0x0000000000000070>  0x0000000000000004 
0x00007ffeefbff698:  0x0000000004018700 <runtime.evacuate_faststr+0x0000000000000220>  0x8700000000001018 
0x00007ffeefbff6a8:  0x0000000000000010  0x0000000004a17e78 
0x00007ffeefbff6b8:  0x0000000000000810  0x000000c0000001a0 
0x00007ffeefbff6c8:  0x00000000040669c9 <runtime.systemstack+0x0000000000000049>  0x0000000000000004 
0x00007ffeefbff6d8:  0x0000000004687060  0x00000000049e3720 
0x00007ffeefbff6e8:  0x00007ffeefbff738  0x00000000040668c5 <runtime.mstart+0x0000000000000005> 
0x00007ffeefbff6f8:  0x000000000406687d <runtime.rt0_go+0x000000000000013d> 
runtime.sigpanic()
	/opt/macports-test/lib/go/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall, locked to thread]:
syscall.syscall(0x42cd360, 0x1, 0x40487413, 0xc0001cb8d8)
	/opt/macports-test/lib/go/src/runtime/sys_darwin.go:22 +0x3b fp=0xc0001cb848 sp=0xc0001cb828 pc=0x40655db
syscall.syscall(0x40a9ca6, 0x4012514, 0xc0001cb900, 0x40a9bd8)
	<autogenerated>:1 +0x26 fp=0xc0001cb890 sp=0xc0001cb848 pc=0x406b246
golang.org/x/sys/unix.ioctl(0x45ea62d, 0x4, 0x1000000000008)
	/Users/hgillot/go/pkg/mod/golang.org/x/[email protected]/unix/zsyscall_darwin_amd64.go:689 +0x39 fp=0xc0001cb8c0 sp=0xc0001cb890 pc=0x42ccff9
golang.org/x/sys/unix.IoctlGetTermios(...)
	/Users/hgillot/go/pkg/mod/golang.org/x/[email protected]/unix/ioctl.go:72
github.com/mattn/go-isatty.IsTerminal(0x45ea62d)
	/Users/hgillot/go/pkg/mod/github.com/mattn/[email protected]/isatty_bsd.go:10 +0x50 fp=0xc0001cb930 sp=0xc0001cb8c0 pc=0x42cd470
github.com/fatih/color.init()
	/Users/hgillot/go/pkg/mod/github.com/fatih/[email protected]/color.go:21 +0x7a fp=0xc0001cb968 sp=0xc0001cb930 pc=0x42cdc5a
runtime.doInit(0x4941200)
	/opt/macports-test/lib/go/src/runtime/proc.go:6498 +0x123 fp=0xc0001cbaa0 sp=0xc0001cb968 pc=0x4048063
runtime.doInit(0x49411a0)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbbd8 sp=0xc0001cbaa0 pc=0x4047fb1
runtime.doInit(0x493e300)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbd10 sp=0xc0001cbbd8 pc=0x4047fb1
runtime.doInit(0x4941b00)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbe48 sp=0xc0001cbd10 pc=0x4047fb1
runtime.doInit(0x493c780)
	/opt/macports-test/lib/go/src/runtime/proc.go:6475 +0x71 fp=0xc0001cbf80 sp=0xc0001cbe48 pc=0x4047fb1
runtime.main()
	/opt/macports-test/lib/go/src/runtime/proc.go:238 +0x1e6 fp=0xc0001cbfe0 sp=0xc0001cbf80 pc=0x403af26
runtime.goexit()
	/opt/macports-test/lib/go/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc0001cbfe8 sp=0xc0001cbfe0 pc=0x4068ba1

To Reproduce
Steps to reproduce the behavior:

  1. Ensure running macOS on an x86_64 Intel host
  2. Ensure Go is version 1.17+
  3. Checkout dblab and switch to v0.13.0 branch
  4. make build
  5. Attempt to run dblab

Expected behavior
dblab runs normally.

OS (please complete the following information):

  • macOS Catalina 10.15.7, Intel x85_64

Additional context

  • Go 1.17.3

[FEATURE] add multiple query execution

Is your feature request related to a problem? Please describe..

It should be good enough to allow users to run multiple queries independently, for example:

image

Here we can see that we have 2 queries and when we try to execute the first one it fails because of a SQL syntax problem.
But if we delete the second query and execute the first one, it returns ok:

image

Is this a real problem or an upcoming feature? (maybe I'm stupid and you can execute more than one query)

Re-fresh Session/Connection

Is your feature request related to a problem? Please describe.

It's odd to see that when a database container is shutting down, dblab doesn't do anything about it.
The expected behavior: when that happen, dblab should return an error message.

Describe the solution you'd like

It would be nice if dblab let you know that the session/connection has expired and then display some sort of form to get the new values for a new database connection (just like pgweb does).

Describe alternatives you've considered

Another options is just stop the execution and show an error message on the std output.

Migrate completely to bubbletea

Is your feature request related to a problem? Please describe.

dblab relies on a fork of gocui which has been pretty inactive for 3 years, now. So, I think it's time to migrate completely to bubbletea.

Describe the solution you'd like

I'm proposing a complete rewrite of the UI adopting bubbletea and ditching gocui. Can't guarantee that dblab is gonna look the same, maybe a bit similar to what we have today.

Describe alternatives you've considered

There's no alternative, it's only bubbletea.

Additional context
If I manage to pull it off, I may improve the text input capabilities of dblab to improve the experience of typing really long queries.

To migrate successfuly to bubbletea, I need to scope out a new plan to migrate to buubletea.

First off, it;s necessary to list the components of the current UI and see if bubbletea offers similar widgets.

UI Components:

  1. List of tables
  2. Navigation table
  3. Text input (where uses type queries)
  4. Resultset View
  5. Pagination widget

Description of each component

List of tables

This the widget where the available tables are listed. The user can switch to this view and press enter on any to list the first items of that list.

Navigation table

This a widget that shows a menu that displays four options:

  • Rows that displays the first records on a selected table
  • Structure that displays the structure of the selected table
  • Constraints that shows the constraints on a given table
  • Indexes that displays the indexes on a selected table

The user can switch between tabs using key bidings.

Text input

This might be the simplest component right now. It only accepts text and execute queries by pressing ctrl + Space. It could be more complex if I add autocomplete capabilities.

Resultset view

This is where the resultsets are displayed, it highly relies on tables widgets to work. Any kind of migrations should respect current key bindings to navigate through it.

Pagination widget

This is used to navigate through the pages given an offset.

"go-sqlite3 requires cgo to work. This is a stub"

Describe the bug
dblab does not start on Windows given an sqlite db. It fails with error message Error: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

To Reproduce
Steps to reproduce the behavior:

  1. Download dblab_0.16.0_windows_amd64.tar.gz
  2. Extract
  3. Open Windows-Terminal app in extracted Folder
  4. Try to open an sqlite db by running .\dblab.exe --driver sqlite3 --db "P:\ath\To\sqlite.db"

Expected behavior
dblab opens

OS (please complete the following information):

  • Microsoft Windows 10 Pro x64 Version 10.0.19044 Build 19044

Multi session

Is your feature request related to a problem? Please describe.
Many other database clients stores the encrypted connection, somewhere. It'd be nice to have something like that available on dblab.

Describe the solution you'd like
dblab may have a system intended to store previous connections, somewhere in the local file system. We may add a flag to access to an special menu with the list of the old connections, be able to select one, and provide a password and decrypt it to open a connection with the database.

Describe alternatives you've considered
Don't have other alternatives

[FEATURE] readonly mode cli option and/or TUI toggle

Is your feature request related to a problem? Please describe.
can you please add an option to open up a db in readonly mode?

Describe the solution you'd like
a cli and/or TUI option to create a connection in readonly , or maybe toggle the current db session into a readonly session

Describe alternatives you've considered

Additional context

[FEATURE] It might be a good idea to add a CONTRIBUTION file and a CODE_OF_CONDUCT

Is your feature request related to a problem? Please describe.
I'd like to contribute with the code of dblab, but I don't know very well golang

Describe the solution you'd like
Maybe could be a good idea to add a CONTRIBUTING file for new contributors to get some context of the project and for the environment setup, also could be a good idea to add a CODE_OF_CONDUCT to the repo, for the interaction between developers

Describe alternatives you've considered
I tried to run the code after I cloned, but I got an error Error: empty values required to open a session in database,
I'm using Goland, then I noticed that I'm running the app without parameters so when I added --help, the error disappear

[FEATURE] Add query completion and syntax highlighting

Describe the solution you'd like
It would be a good feature to complete via TAB SQL words and table names, columns, etc. while typing SQL queries in SQL Query panel

Describe alternatives you've considered
There is a cli tool usql written in Go with syntax highlighting and code completion. You could check how this feature is implemented there.

Show a description of a selected table

Is your feature request related to a problem? Please describe.

Sometimes, is required to see the structure of certain tables to query them in a proper way, It's helpful to see, either, how many tables are in the table or what kind of type the columns are.

Describe the solution you'd like
I'd want to have a view to see a table describing the selected table from those available in the database.

Describe alternatives you've considered
I've been considering even switch to another tui framework to show mentioned view above, but I realized that I could put views on top of others and switch accordingly.

Additional context
I revisited the examples provided by gocui and I find a useful one.

dblab-sqlite3 does not work on OSX

Describe the bug
when try to execute dblab-sqlite on OSX gives this error

Error: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

To Reproduce
Steps to reproduce the behavior:

  1. Download https://github.com/danvergara/dblab/releases/download/v0.16.0/dblab_0.16.0_darwin_arm64.tar.gz
  2. extract and move executable to a directory on path
  3. execute it
  4. See error

Expected behavior
open the database and show the content

Screenshots
Screen Shot 2022-09-24 at 19 34 33

OS (please complete the following information):
โฑ uname -a
Darwin mary3jane.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 arm64

Additional context
Add any other context about the problem here.

Add LIMIT to the table content function

Is your feature request related to a problem? Please describe.

Before adding the pagination feature, we should be adding a limit clause to the SQL query.

Describe the solution you'd like
Through a concise way to pass down variables from the config file/object to the client and the GUI objects. We may be adding an additional field to the config file called limit and special flag the command to control the size of the result set in the table content function.

Describe alternatives you've considered
Didn't consider other alternatives.

Error when viewing table structure

Describe the bug
When pressing 'Enter' on a table, dblab crashes saying 'unknown column 'tc.enforced' in field list

To Reproduce
Steps to reproduce the behavior:

  1. Load a database
  2. Go to a table and press enter

Expected behavior
Should so table structure

OS (please complete the following information):
Arch linux

Additional context
This is when connecting to a mariaDB database

Implement a better validation for mysql url connection

Is your feature request related to a problem? Please describe.
Currenty, I haven't implemented a reliable way to validate mysql urls, due to their peculiarities (e. x. user:password@tcp(localhost:5555)/dbname?tls=skip-verify&autocommit=true). I tried to use url package, but it is not able to parse those kind of urls.

Describe the solution you'd like
From my point of view, we should implement our regex solution to parse and validate those kind of urls.

Describe alternatives you've considered
I considered the use of dburl, but that package doesn't support mysql urls connection strings either.
Maybe we could take advantage of regexp from the standard library.

[FEATURE] Add a tutorial about the usage of the config file

Currently in the documentation there's only 1 tutorial for the use of dblab using the interactive setup. We should also have one using the config file

Create a new tutorial page containing the example step by step of the usage of the config file.

How to improve the display of characters by Terminal?

Describe the bug
I'm running, in a terminal (konsole), TERM=xterm.
Character rendering is very bad.

To Reproduce

  • Kubuntu 23.04
  • Terminal Konsole;
  • TERM=xterm
  • Default character encode: IBM850

Screenshots
image

OS (please complete the following information):

  • Kubuntu 23.04

Additional context
Konsole Settings:

image

Support MySQL / MariaDB Sockets

Hello,

most databases I have to work with have no password for root user.
They use socket auth instead.

 mysql -S /var/run/mysqld/mysqld.sock
  -S, --socket=name   The socket file to use for connection.

Can that be supported?

Cheers!

[FEATURE] Add suport for config file like .db.yaml

Is your feature request related to a problem? Please describe.
Many tools like this, provide support for config files to customize or automate some tasks.

Describe the solution you'd like
Now, there are two ways to run the cli:

  1. By specifying the main individual flags:
$ dblab --host localhost --user myuser --db users --pass password --ssl disable --port 5432 --driver postgres
  1. By defining the url flags:
$ db --url postgres://user:password@host:port/database

What if we'd just run the single binary with no flags, but a .dblab.yaml file has to be present with the necessary parameters to execute the application.

Example:

config:
   host: localhost
   user: myuser
   db: users
   pass: password
   port: 5432
   driver: postgres

Describe alternatives you've considered
Other alternative is add a new flag called config that receives the path to the config file:

$ dblab --config ~/path/to/config

Additional context
This was originally proposed by @pa-m

[FEATURE] Add a video of the usage in the main page of the documentation

Right now in the main page of the documentation there's only text describing what is dblab used for, then in the quickstart you can find some videos of the usage but the resolution is not good enough to understand it clearly.

Solution:
The idea is to have 1 short video in the main page with good resolution and with a good example of the features of dblab.
And then updating the videos that are currently in the quick start with new videos with better resolution.

Maybe it would be nice to have this "zoom" effects on the different panels on the video in order to make it easier to read and understand.

"Invalid db url" although it seems very correct

Describe the bug

I run ~/path/to/dblab -u postgres://postgres:postgres@localhost:5432/mydb?sslmode=disable and get the following error (the db url is valid, I use it with psql and other tools.

Error: postgres://postgres:postgres@localhost:5432/openfindata?sslmode=disable: invalid url
Usage:
  dblab [flags]
  dblab [command]

Available Commands:
  help        Help about any command
  version     The version of the project

Flags:
      --config          get the connection data from a config file (default is $HOME/.dblab.yaml or the current directory)
      --db string       Database name
      --driver string   Database driver
  -h, --help            help for dblab
      --host string     Server host name or IP
      --pass string     Password for user
      --port string     Server port
      --ssl string      SSL mode
  -u, --url string      Database connection string
      --user string     Database user

Use "dblab [command] --help" for more information about a command.

Error: postgres://postgres:postgres@localhost:5432/openfindata?sslmode=disable: invalid url

As a bonus problem, my shell is messed up after the crash (typed text on the command line is invisible), and I need to reset it to be able to see my input again.

To Reproduce
Steps to reproduce the behavior:

  1. run ~/path/to/dblab -u postgres://postgres:postgres@localhost:5432/mydb?sslmode=disable
  2. see error above

Expected behavior
A valid url should not fail, and the terminal should be left like it was.

Screenshots
N/A

OS (please complete the following information):

Additional context

[FEATURE] Idea โ€“ Saving the first time configuration

Is your feature request related to a problem? Please describe.
image
I was using dblab, and I noticed that I had to enter my configuration every time I run dblab without --config flag
Describe the solution you'd like
I think it could be cool to have the option to save the first time configuration, so we can get the existing configuration after the first time I run dblab.
So with don't have to run ./dblab --config every time that we want to run the app.
Describe alternatives you've considered
It works well with --config flag
Additional context
I'm not sure where the configuration could be saved
Also, what happen if I would rather not use the first time configuration anymore ๐Ÿค”

Is it possible to support SQLite

Is your feature request related to a problem? Please describe.
It's not related to a specific problem, just I'm wondering if is it possible to use dblab with SQLite

Describe the solution you'd like
I think could be possible support SQLite, but I'm not sure

Describe alternatives you've considered
I tried to use dblab with postgres, but I'd like to just play around with dblab and a lightweight database as SQLite

Additional context
Maybe as SQLite is also an SQL database, it might be possible to support SQLite

Sqlite3 interactive menu prompts for host and port

Describe the bug
I was thinking that sqlite3 option should ask for the path of the SQLite file instead of host and port. What do you think?

To Reproduce
Steps to reproduce the behavior:

  1. Build the app with the latest updates
  2. run ./dblab
  3. select sqlite3 option
  4. The prompt asks for host and port

Expected behavior
I think the app should ask for the path of the SQLite file

Screenshots
image

OS (please complete the following information):

  • MacOS Monterey v12.4

Additional context
N/A

[FEATURE] Multi schemas

Is your feature request related to a problem? Please describe.
I have a database with multiple schemas, but I am unable to select the schemas that I need.

Describe the solution you'd like
I think it could be great to have the option to select the schemas that we want to show of the database, or maybe could be shown in a panel with the schemas.

Describe alternatives you've considered
Currently, I think there is no workaround to work with multiple schemas

Additional context
This is an example with the following schemas:
image
image
I think currently we are only showing the public schema:
image
I was looking for examples and I found this:
image
We can select the schemas that we need and are shown like this:
image

[FEATURE] Support PostgreSQL unix socket connection

Is your feature request related to a problem? Please describe.
I'd like to connect to postgresql using unix socket.

Describe the solution you'd like
Either explicit unix socket support like for mysql or host=/run/postgresql syntax like postgres tools usually support.

Pagination

Is your feature request related to a problem? Please describe.

The table selection has a serious problem when it comes to query big tables, by default is gonna return all the records from the selected table which resource intensive.

Describe the solution you'd like

The best we can do is adding a pagination system. I'm considering to add an small view with a kind of menu to handle the pagination as we usually do in web applications. The system might be pretty much like the view selection menu, and besides I could add some short cuts to have a better UX.

Describe alternatives you've considered

Another option is to add an special configuration to declare a maximun number of rows given by the user, the default might be 100.

Migrate dblab to a new tui framework

Is your feature request related to a problem? Please describe.
The current framework that dbladb relies on is gocui, but is not under active development. So, if we spot a nasty bug or we can add extra functionality out of those we currently have, we're not gonna be able fix or add them.

Describe the solution you'd like
I'm proposing to migrate to lipbgloss, which is another alternative that is under active development and looks nicer than the current solution.

Describe alternatives you've considered
I considered temui, but it's not an option because of the lack of critical features. I was a direct competitor to gocui at the beginning.

Additional context
I'm considering to add a view to show the schema of the selected table on the interface, but currenly we don't have available space to do so. I'm thinking to take advantage of the tabs feature that lipgloss provides as show below:
lipgloss

[FEATURE] Add documentation with mkdocs

Currently the only documentation for the project is in the repo and in the help command of the cli
It would be nice to have a documentation page in order to describe the features of the library and also to expose examples and tutorials that can help new adopters.

The documentation would be created with MKDocs and the material template since it looks clean and it is easy to navigate. Also it is easy to maintain and update using github actions.

Redraw UI on terminal resize

Describe the bug

Currently resizing the terminal does not redraw the UI leaving it the wrong size and data hidden.

To Reproduce
Steps to reproduce the behavior:

  1. Launch dblab
  2. Resize terminal

Expected behavior
The UI to redraw to the new terminal size.

Screenshots
If applicable, add screenshots to help explain your problem.
2022-10-03_230336

OS (please complete the following information):

  • Linux archlinux 5.19.3-arch1-1 x86_64 GNU/Linux
  • alacritty terminal
  • tmux

Additional context
Add any other context about the problem here.

Web app to see the content on the browser

Is your feature request related to a problem? Please describe.
For some people, the terminal is a little less expressive than the desktop or web applications, so we can provide another experience to those potential users

Describe the solution you'd like
My proposed solutions is to spin up a web server that serves a web application that displays the database content.

Describe alternatives you've considered
I've considered a GUI app, but not sure about the esthetics capabilities of the GUI frameworks.

[FEATURE] Add SSL flags usage for PostgreSQL to the docs

Is your feature request related to a problem? Please describe.
Add the documentation for the SSL flags usage for PostgreSQL

Describe the solution you'd like
Clearly explain the usage of the SSL flags and add it to the usage file in the documentation.

Describe alternatives you've considered
If possible also add an example of this into the tutorials section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.