GithubHelp home page GithubHelp logo

lazysql's People

Contributors

danprueitt avatar gusjelly avatar jorgerojas26 avatar kevengoncalves avatar konart avatar linpr 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  avatar  avatar

lazysql's Issues

[feat]: SQlite

Good cli app concept.

SQlite support would be good as well as future development.

Support for NULL

Hi, Looks like there is no support for null.

for example:

image
image

email_verified_at is nullable. and user id 1 has is set to null. there are 2 issues with this:

  1. Shows as a empty string in the table. should maybe be shown as "(null)" with even another text color if possible.
  2. Unable to set a value to null on either an existing row or when creating a new row.

attaching a image to show what happens to a datetime when trying to set a empty value. this is maybe fine as an emtpy value is actually not null. it fails correctly i think.

image

however you can't set it to "null" as it is still a string.

image

I think the cleanest way to solve this is to have a keybind i cell edit mode (maybe Ctrl + N) that will set the column to null. What do you guys think?

Cannot commit changes

Issue Summary
When I go to save a change, I get this error:

Unknown column 'id' in 'where clause'

Steps to Reproduce

  1. Connect to database
  2. View cell, press c to edit, modify text
  3. Press ctrl+s to try and commit change

image

Cannot open databases with all-numeric names

Using build 0.1.8 in Debian Bookworm under WLS2

I noticed this connected to two similarly configured MySQL servers.
I do not know if it is a MySQL specific problem or not.

I can see all the databases in the table panel.
I can open ones with letters in their names, even if they start with a number.
All-numeric databases do not open. I can select them but nothing happens when I press enter.

I hope this is helpful, thanks!

WSL Error missing X11

❯ go install github.com/jorgerojas26/lazysql@latest
go: downloading github.com/jorgerojas26/lazysql v0.1.2
go: downloading golang.design/x/clipboard v0.7.0
go: downloading github.com/rivo/tview v0.0.0-20240101144852-b3bd1aa5e9f2
go: downloading github.com/google/uuid v1.5.0
go: downloading github.com/xo/dburl v0.20.2
go: downloading github.com/gdamore/tcell/v2 v2.7.0
go: downloading github.com/pelletier/go-toml/v2 v2.1.1
go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
go: downloading golang.org/x/sys v0.15.0
go: downloading golang.org/x/term v0.15.0
go: downloading github.com/gdamore/encoding v1.0.0
go: downloading github.com/mattn/go-runewidth v0.0.15
go: downloading github.com/rivo/uniseg v0.4.3
# golang.design/x/clipboard
clipboard_linux.c:15:10: fatal error: X11/Xlib.h: No such file or directory
   15 | #include <X11/Xlib.h>
compilation terminated.

System executed the command:
Win11 with WSL2 Ubuntu 22.04.3 LTS

Issues with Colorusage and Readability

So, i'm not sure on which end this issue is, but i'm not getting the same color output as your screenshots do
grafik

Especially the unfocused treeview is using a Blue no matter which colorscheme i use. This is in Windows Terminal, tested with 3 colorschemes.

Additionally i feel like the contrast on the selected cell is pretty low. A darker foreground color for that would help readability.

[improve]: Improve the colors

The lazysql show colors different from the normal terminal, would be great if the lazysql match the same colors like the terminal, something that happen in lazy-like TUIs like lazygit and lazydocker:

What we have:
Captura de Tela 2024-01-20 às 12 35 00

What is expected (the image bellow is photoshopped):
Captura de Tela 2024-01-20 às 12 35 00 - cópia

I haven't figured what I can change in the code to get this

Enhancement: Make the project downloadable with go install

I like to download my tools with go install, but this project is not set up for this.
The error code:

go install github.com/jorgerojas26/lazysql@latest
go: downloading github.com/jorgerojas26/lazysql v0.1.0
go: github.com/jorgerojas26/lazysql@latest: version constraints conflict:
        github.com/jorgerojas26/[email protected]: parsing go.mod:
        module declares its path as: lazysql
                but was required as: github.com/jorgerojas26/lazysql

I can make a PR that fixes this if this is something you'd like.

What is valid database scheme?

image

What should I put into the URL ??

I've tried:

jdbc:mysql://hostname:port/database
jdbc:mysql://hostname:port/database?user=username&password=userpassword
hostname:port

but none of them work, showing unknown database scheme.

fatal error: X11/Xlib.h: No such file or directory

I'm on NixOS 23.11, using sway on wayland. When trying to build this via Go, ran into this error. I'm curious if this is due to being on wayland?

Steps to reproduce:

On NixOS, running the Sway wm.

  1. Opened terminal (I am using foot)
  2. nix-shell -p go
  3. go install github.com/jorgerojas26/lazysql@latest

It will result in:

# golang.design/x/clipboard
clipboard_linux.c:15:10: fatal error: X11/Xlib.h: No such file or directory
   15 | #include <X11/Xlib.h>
      |          ^~~~~~~~~~~~
compilation terminated.

image

PKGBUILD for Archlinux

Hey, I find great interest in your project, and I hope it will make it as far as lazygit did.

I created a PKGBUILD for this project, so that users of archlinux can install this package.

It's available here: https://aur.archlinux.org/packages/lazysql

Maybe you can update the readme to include it.

Just write something along the lines:

Archlinux users can install it from here: https://aur.archlinux.org/packages/lazysql
via paru -S lazysql or yay -S lazysql or by downloading the PKGBUILD file and running makepkg -si

bug: app breaks when trying to open a connection with no /

This looks like a simple bug, i downloaded lazysql to try it via go install, and added my local sqlite db to try it.
I added it with a relative path for url on the connection and the "test connection" show it was correct.
I saved and returned to the home screen and selected the db and lazysql panicked.
image

I tried setting the URL as "./data.db" instead and it works that way.

Already took a look at the code on the line shown in the error and i figured it really expects to have at least on '/', this is the line:

return strings.Split(url, "/")[1]

I figure it should at least just use the whole string if there are no slashes to be found in the path.

I may go and submit a PR with it myself later, but I thought I should at least create an issue even if just documenting the problem in case I forget to go and fix it myself.

Cannot connect to Postgres database using ODBC

I tried to create a connection to remote Postgres database using ODBC and got an error unknown driver "odbc" (forgotten import?)

image

Also when I tried to save a connection I got an error cannot parse odbc+postgres://

image

I am using version 0.1.6-1 from AUR.

[feat]: MSSQL Support

As a user of lazygit, this would be perfect for me, if only it had MSSQL support.

Error while trying to add new row in empty table

In addition, it will be nice if there was some message "Table Empty" instead of error

Full panic error:

panic: runtime error: index out of range [0] with length 0 [recovered]
        panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/application.go:251 +0x4d
panic({0x782400, 0xc0006a6c78})
        /usr/local/go/src/runtime/panic.go:884 +0x213
github.com/jorgerojas26/lazysql/components.(*ResultsTable).tableInputCapture(0xc000266d80, 0xc0006ddc60)
        /Users/jorgerojas/projects/lazysql/components/ResultsTable.go:448 +0x1468
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc000270720?, 0xc0005c7b08?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:164 +0x3a
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0005c7b48?, 0x54e0bf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0002701e0?, 0xc0005c7b88?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0005c7bc8?, 0x558dbf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc000270240?, 0xc0005c7c08?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0005c7c48?, 0x558dbf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000fe5d0?, 0xc0005c7c88?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0005c7cc8?, 0x54e0bf?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc0000fe630?, 0x76d6e0?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Flex).InputHandler.func1(0xc0006ef7e0?, 0xc0005c7d48?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/flex.go:255 +0xd9
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc00007f2f0?, 0x7620e0?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Pages).InputHandler.func1(0x40d507?, 0x10?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/pages.go:311 +0xa7
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc00007f110?, 0xc0005c7e40?)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/box.go:167 +0x53
github.com/rivo/tview.(*Application).Run(0xc00017e000)
        /Users/jorgerojas/.go/pkg/mod/github.com/rivo/[email protected]/application.go:344 +0x57d
main.main()
        /Users/jorgerojas/projects/lazysql/main.go:16 +0x10a

Need help connecting to postgres

I usually connect to postgres database with psql like this:

psql postgresql://postgres:mysecretpassword@localhost:5432/postgres

Using lazysql I can't manage to create a connection though. I get two kinds of error messages when pressing F2 to test the connection.

If I set URL:
postgresql://postgres:mysecretpassword@localhost:5432/postgres
I get error message:
sql: unknown driver "postgres" (forgotten import?)

If I set URL:
localhost:5432/postgres
I get error message
unknown database scheme

Is it just that lazysql doesn't support postgres or am I doing something wrong?

Awesome that you're building lazysql, I use lazygit and lazydocker daily at work. Keep it up!! :)

No idea about what to put in new connection form

I can't guess the required format of my connection values, maybe some placeholder or a (? - help) key and of course, documentation about it can help.

Here's how I wanted to create a connection to the MySQL database of my company
image

Connecting to a mysql database does not seem to work in main branch

Steps to reproduce

  1. clone repo
  2. go run main.go
  3. New connection

My input for the url mysql://root:password@localhost:33061/database

It prints out the following error when trying to test it:

dial tcp: lookup localhost:33061:33061: no such host  

and this error when pressing enter to connect to it

parse "mysql://root:password@localhost:33061%2Fdata": invalid port ":

I did some inspecting in the code and found that it probably has something to do with the EscapeConnectionString function in utils.go
The reason I came to that conclusion is that when replacing this:

connectionString := helpers.EscapeConnectionString(form.GetFormItem(1).(*tview.InputField).GetText())
parsed, err := helpers.ParseConnectionString(connectionString)

with:

parsed, err := helpers.ParseConnectionString(form.GetFormItem(1).(*tview.InputField).GetText())

It seemed to work for my end, however there will be no sanitization done. I don't know enough about the code to change this so I thought I would make just make the issue. Let me know if you need more information from my end.

Bug: program would perminately blocked when operate a empty table

  1. what is the problem?

Bug: program perminately blocked when operate a empty table

  1. How to reproduce this problem

firstly: enter into a empty table
secondly: press up or down key will block the total program forever, and it can not receive keyboard event anymore, even I press ctrl+c . the program still blocked in somewhere

[feat]: support to icons

I'm big fan of TUI like lazygit and lazydocker, and rice terminals, would be nice if lazyqsl had support to icons like others TUIs mentioned here

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.