nvim-dbee icon indicating copy to clipboard operation
nvim-dbee copied to clipboard

Add database switching for mysql connections

Open sgibraltar opened this issue 1 year ago • 3 comments

It exists in other connections, and it is possible in MySql.

This will solve the errors when using MySQL connection and expanding some tables inside another (non-default) schema in the connections tree. Currently, it is only possible for the schema name set in the connection url.

In addition, I modified the URL regex/concatenation logic used for MySQL connection to use cfg = ParseDSN(url) / url = cfg.FormatDSN() which should improve characters escaping for passwords in the connection URL.

sgibraltar avatar Jul 27 '24 09:07 sgibraltar

@kndndrj would appreciate your review. I built it and tested it locally, and connection+switching db works great.

Awesome plugin btw :) I had it for 6 months or so but couldn't do much with it because I use MySQL. Now I can finally use dbee without having to set a connection-per-db (I have 10+ connections with 30+ DB's in each)

sgibraltar avatar Jul 27 '24 10:07 sgibraltar

  • Also made sure the multi-statement functionality worked and was not affected by this change

sgibraltar avatar Jul 27 '24 10:07 sgibraltar

Hey @sgibraltar!

The plugin has been stale for some time, but we have actively started doing work again. Would you mind syncing you branch, and looking over possible needed changes? Then I'd be happy to test and review this PR.

Please also see #180 which adds tests for the mysql adapter 😄

phdah avatar Feb 14 '25 13:02 phdah