tpope / vim-dadbod

dadbod.vim: Modern database interface for Vim
https://www.vim.org/scripts/script.php?script_id=5665
3.69k stars 132 forks source link

DB: no adapter for localhost #183

Open dipzera opened 2 months ago

dipzera commented 2 months ago

Using WSL2, running a dockerized postgres database Installed vim-dadbod using lazy, what am I doing wrong? 😴

image

image

tpope commented 2 months ago

Is that the exact command you're running? Unless your password really is password, I'm guessing no, you ran a different command. And that's where your problem lies, because the command as-is shouldn't give that error.

dipzera commented 2 months ago

Password indeed is password, it's a local db.

dipzera commented 2 months ago

Removed, vim-dadbod-ui package and it works now, looks like it was conflicting with it.

amns13 commented 2 months ago

This happened to me as well for postgres. And the resolution was also same. I had to remove vim-dadbod-ui package

kristijanhusak commented 2 months ago

@dipzera @amns13 can you clarify how this conflicts with vim-dadbod-ui?

amns13 commented 2 months ago

@kristijanhusak Sorry for late reply. Turns out I had missplled postgres as posgres while initially configuring. After cloning both repos locally and doing some debugging, I found out that I can't read/spell.

I noticed 1 weird behaviour though. :DBUI command was failing with the no adapters for posgres error message, which is expected. But, even :DB was failing even when provided with the correct uri. When I disabled dadbod-ui, :DB started to work. This is what led me to beleive that it may be some conflict with dbui extension

@dipzera You can check ~/.local/share/db_ui/connections.json to see whether you have added the proper initial url or not.

Normanras commented 1 month ago

@amns13 Thanks for the heads up on checking the connections file. I recently opened an issue on dadbod-ui because I was getting a similar "no apadtors" error but it was forno adaptors for https. I'm connecting to a remote aws db but thepsql` command works perfectly.

If I remove dadbod-ui and just use this plugin, I get no connection errors, but also the expected behavior of dadbod doesn't work and I can't query my db. A little stumped by this....

Edit: And the answer was in connections.json. Clearing that our resolved the issue!

dzintars commented 1 month ago

Seen this error when I had faulty connection record in the ~/.local/share/db_ui/connections.json despite DB_UI_DEV ENV was correct. Removed faulty record from config and it resolved this error.