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

Possible to View Tables?

Open jtw023 opened this issue 2 years ago • 9 comments

Hi, I have a problem likely from my own error(will attach a screenshot below).

Under Schemas on the left side everything shows (0) next to it. Should I be able to see all tables and what's in those tables? I can access everything when querying so it knows what's there, just doesn't show up on the gui.

2022-05-04_12-00

jtw023 avatar May 04 '22 19:05 jtw023

UPDATE: Initiating a new query and running show search_path returns $user, then one of my schemas. Strangely, I can't even see the tables inside that one schema. Continuing debugging.

jtw023 avatar May 17 '22 00:05 jtw023

I haven't been able to get the schema browser working but vim-dadbod-completion is able to view everything, solves the same problem. I think I like the completion element better anyways lol. Should I close this issue or is it something you'd like to leave open to continue working on?

As a side note, thank you for these plugins! Working with sql straight from neovim makes me a happy guy! I love it. :)

jtw023 avatar May 18 '22 00:05 jtw023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '22 18:06 stale[bot]

I think this is permission related issue. Can you tell me what you get from these 2 queries:

This one should return the schemes

    SELECT nspname as schema_name
    FROM pg_catalog.pg_namespace
    WHERE nspname !~ '^pg_temp_'
       and pg_catalog.has_schema_privilege(current_user, nspname, 'USAGE')
    order by nspname"

This one should return all tables from all schemas, but it seems it's not returning it for you

SELECT table_schema, table_name FROM information_schema.tables

kristijanhusak avatar Jun 19 '22 13:06 kristijanhusak

Interesting, those queries are both returning all schemas and tables that my user has access to. I gave my connection the same name as one of my schemas though. Could that be causing the issue?

Edit: I changed the connection name and the same issue still occurs.

One other theory I have is that I'm using a PostgreSQL URL to connect to Amazon Redshift, since Redshift isn't officially supported. Maybe something is slightly off?

jtw023 avatar Jun 23 '22 00:06 jtw023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '22 15:07 stale[bot]

I'm seeing the same behavior connecting to local postgres containers. I also get proper autocompletion from "vim-dadbod-completion".

gerrard00 avatar Aug 26 '22 15:08 gerrard00

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 25 '22 20:09 stale[bot]

For anyone who comes across this, there is a temp fix on issue #124. It's not ideal but this solves the problem until a current fix can be made. :)

jtw023 avatar Feb 24 '23 03:02 jtw023