Closed napisani closed 1 year ago
Hey @napisani, thanks for trying out the plugin.
I probably won't be able to check anything with my pc thia week, but nonetheless, lets try some things:
I see you aren't calling the setup function from packer (e.g. you aren't lazy loading the plugin) For some reason nvim has some trouble running go commands on startup. Try putting lazy = true
in your config, so the setup looks like this:
dbee.setup({
lazy = true,
connections = {
{
name = "examplemysql",
type = "mysql",
url = "mysql://root:redacted@localhost:3306/db1",
},
}
})
Please let me know if it works!
Thank you, I think I'm one step closer now. Although now I'm running to this error after running the following command
Cmd:
lua require("dbee").execute("select * from person")
Error:
connection with id examplemysqlmysql not registered
Sorry to be a pain, but I appreciate your help
Hey, can you try that again and then run :mes
and paste the output here?
Also, can you paste the contents of ~/.cache/nvim/dbee/dbee.log
?
It would be helpful to have some sort of logs
P.S. don't worry I value this kind of feedback :D
Sure thing, tried it again, followed by the :mes
command. However there were no messages to be found in the messages panel
here is what the dbee.log file contained after doing those two commands:
~ ❯ cat ~/.cache/nvim/dbee/dbee.log
2023/05/15 11:59:50 [DebugLevel]: calling Dbee_register_connection
2023/05/15 11:59:50 [ErrorLevel]: Unable to connect to database: default addr for network 'localhost:3306' unknown
2023/05/15 11:59:50 [DebugLevel]: calling Dbee_set_results_buf
2023/05/15 11:59:50 [DebugLevel]: Dbee_set_results_buf returned successfully
2023/05/15 11:59:50 [DebugLevel]: calling Dbee_execute
2023/05/15 11:59:50 [ErrorLevel]: connection with id examplemysqlmysql not registered
I hope you didnt spent too much time racking your brain on this one. I was able to finally get it working by changing my connection string to this format:
dbee.setup({
lazy = true,
connections = {
{
name = "examplemysql",
type = "mysql",
url = "root:password@(localhost:3306)/db1",
},
},
})
Thanks again for your help!
Hi there!
I'm really looking forward to trying out this plugin. Also, I'm really fascinated to read through your code and see how the go-lua interop works.
When I first attempted to setup a connection to my local db, I started getting this error on startup and all subsequent execution commands seemed to fail as well.
Here is a screenshot of the error
Here is my configuration:
Packer:
here is my config function called from my init.vim file:
Is there a mistake that I made in the config? Thanks in advance, ~Nick