Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(table helpers): allow removing default table helpers #294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Cih2001
Copy link

@Cih2001 Cih2001 commented Dec 3, 2024

This will let users to remove default table helpers. I have something like the following in my neovim config:

vim.cmd([[
let g:db_ui_table_helpers = {
\   'postgresql': {
\     'List': "select * from {schema}.{table} limit 2;",
\     'Columns': "",
\     'Primary Keys': "",
\     'Indexes': "",
\     'References': "",
\     'Foreign Keys': "",
\     'Info': "select format('%s.%s', table_schema, table_name) as tablename,  column_name, column_default, is_nullable, data_type\n
\from information_schema.columns where table_name='{table}' and table_schema='{schema}' order by ordinal_position asc;\n
\select format('%s.%s', schemaname, tablename) as tablename, indexname, indexdef from pg_indexes where tablename='{table}' and schemaname='{schema}';\n
\select conrelid::regclass as tablename, conname, pg_get_constraintdef(oid) from pg_constraint\n
\where conrelid::regclass::text = '{schema}.{table}' order by contype desc;\n
\select conrelid::regclass as dependancies, conname, pg_get_constraintdef(oid) from pg_constraint\n
\where confrelid::regclass::text = '{schema}.{table}'order by contype desc;"
\   }
\ }
]])

Which removes the default helpers I don't use.

@Cih2001 Cih2001 changed the title allow removing default table helpers feat(table helpers): allow removing default table helpers Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant