Skip to content

Question: How to view columns when expanding table rather than table helpers?Β #162

Open
@jtw023

Description

@jtw023

I've looked through past issues and haven't found an answer. Apologies if I've missed it and this is a duplicate of another question.

I'm using MacOS Ventura, Kitty terminal emulator, and am connecting to an Amazon Redshift database using psql. My dadbod_ui config is at the bottom and I'm also attaching a screenshot right below this question for clarity. Do you know how I might show columns when expanding a table in the drawer rather than showing table helpers? Perhaps I can show the resulting columns from the query on the right of the screenshot?

Screenshot 2023-03-13 at 11 11 00 PM

This is my $HOME/.config/nvim/lua/plug-dadbod.lua:

-- Add to line 33 in:
-- $HOME/.config/nvim/autoload/plugged/vim-dadbod-ui/autoload/db_ui/schemas.vim
--
-- let s:postgres_tables_and_views = "
--       \ SELECT table_schema, table_name FROM information_schema.tables ;"
-- " let s:postgres_tables_and_views = "
-- "       \ SELECT table_schema, table_name FROM information_schema.tables UNION ALL
-- "       \ select schemaname, matviewname from pg_matviews;"

-- vvv     Potential solution to show columns instead of above query    vvv
-- let s:postgres_tables_and_views = "
--       \ SELECT t.table_schema, t.table_name, c.column_name
--       \ FROM information_schema.tables AS t
--       \ INNER JOIN information_schema.columns AS c
--       \ ON t.table_name = c.table_name ;"

-- Add to line 14 in:
-- $HOME/.config/nvim/autoload/plugged/vim-dadbod-ui/autoload/db_ui/table_helpers.vim
--
--  \ 'Columns': "SELECT column_name from information_schema.columns WHERE table_name='{table}' AND table_schema='{schema}'",
-- "\ 'Columns': "select * from information_schema.columns where table_name='{table}' and table_schema='{schema}'",


vim.g.db_ui_use_nerd_fonts = 1
vim.g.db_ui_execute_on_save = 0
vim.g.db_ui_save_location = 'full_path_to_save_location'
vim.g.completion_matching_strategy_list = {'exact', 'substring'}
vim.g.completion_matching_ignore_case = 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions