Skip to content

Conversation

Cih2001
Copy link
Contributor

@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
@Cih2001
Copy link
Contributor Author

Cih2001 commented Mar 26, 2025

Hey @kristijanhusak, Any plan to merge this?

@kristijanhusak kristijanhusak merged commit 5a83ee1 into kristijanhusak:master Oct 15, 2025
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.

2 participants