vim-dadbod icon indicating copy to clipboard operation
vim-dadbod copied to clipboard

DB: no adapter for localhost

Open vgorea opened this issue 1 year ago • 12 comments

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

image

image

vgorea avatar Aug 12 '24 15:08 vgorea

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.

tpope avatar Aug 12 '24 15:08 tpope

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

vgorea avatar Aug 12 '24 15:08 vgorea

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

vgorea avatar Aug 12 '24 15:08 vgorea

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

amns13 avatar Aug 12 '24 17:08 amns13

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

kristijanhusak avatar Aug 12 '24 20:08 kristijanhusak

@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.

amns13 avatar Aug 15 '24 11:08 amns13

@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 for no adaptors for https. I'm connecting to a remote aws db but the psql` 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!

Normanras avatar Sep 09 '24 14:09 Normanras

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.

dzintars avatar Sep 22 '24 13:09 dzintars

@dzintars I encountered the same issue, where dadbod worked fine without DBUI but failed when using it. It kept giving me the "no adapter for localhost" error. After reading your reply, I deleted the connection error, and everything is working as expected now. Thanks for the help!

arash-jafarpour avatar Jan 02 '25 19:01 arash-jafarpour

I have the same issue, @kristijanhusak , would you consider to fix it?

TayTTo avatar Feb 24 '25 13:02 TayTTo

@TayTTo open up an issue on https://github.com/kristijanhusak/vim-dadbod-ui with reproducible steps and I can take a look.

kristijanhusak avatar Feb 24 '25 13:02 kristijanhusak

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.

if you don't find the path above try this one: ./.local/share/nvim/dadbod_ui/connections.json

bernoussama avatar Aug 18 '25 21:08 bernoussama