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

Can't query database at all

Open dvd42 opened this issue 1 year ago • 1 comments

I am trying to connect to a redshift database. However, I am having trouble making it work. It seems that now Dbee connects, as per the logs:

2024/05/16 01:48:41 [info]: calling method "DbeeGetConnections" 2024/05/16 01:48:41 [info]: method "DbeeGetConnections" returned successfully

However on the UI I see:

image

So it seems like it has not connected after all. Here is the config I am using:

require("dbee").setup {
sources = {
 require("dbee.sources").MemorySource:new({
   {
     name = "data_warehouse",
     type = "postgres",
     url = "postgres://user:pass@url:5439",
   },
  }),

I am extremely confused, what am I missing?

dvd42 avatar May 15 '24 23:05 dvd42

Ok I can actually query it, but It shows as disconnected as seen in the image and whenever I try to toggle the tree node on the connection I get:

E5108: Error executing lua: function DbeeConnectionGetStructure[1]..remote#define#request, line 2: Vim(let):Error invoking '0:function:DbeeConnectionGetStructure' on channel 6:
c.GetStructure: conn.QueryContext: pq: relation "pg_matviews" does not exist. 

Is this expected?

dvd42 avatar May 16 '24 00:05 dvd42

Hey @dvd42 what's the status on this issue? There is a redshift driver now, so I recommend you to use that one. TL;DR it is using the pg driver under-the-hood but just add type: redshift in the connection param.

MattiasMTS avatar Mar 09 '25 16:03 MattiasMTS

@MattiasMTS, I had forgotten about this. I just tried it, and yes, that did it! Thanks! Closing the issue now.

dvd42 avatar Mar 27 '25 15:03 dvd42