Skip to content

Big Query tables not appearing #341

@pbowman2snap

Description

@pbowman2snap

I'm having trouble bringing up the table names for the schemas in bigquery.....

I don't think my config has anything to do with it:

{
    "kristijanhusak/vim-dadbod-ui",
    dependencies = {
      "tpope/vim-dadbod",
    },
    config = function()
      local lk = require("config.keymaps").lk
      local nmap = require("config.utils").norm_keyset
      local gv = vim.g
      local api = vim.api

      local dbcons_file = "~/.config/db_ui_connections/connections.json"
      gv["db_ui_save_location"] = "~/.config/db_ui_connections"
      gv.db_ui_use_nerd_fonts = 1

      api.nvim_create_user_command("EditDbConns", "e " .. dbcons_file .. "", {})

      nmap(lk.database.key .. "u", "DBUIToggle<CR>:set nu<CR>:set relativenumber", "Toggle DB UI")
      nmap(lk.database.key .. "f", "DBUIFindBuffer", "Find DB Buffer")
      nmap(lk.database.key .. "r", "DBUIRenameBuffer", "Rename DB Buffer")
      nmap(lk.database.key .. "l", "DBUILastQueryInfo", "Run Last Query")
      vim.keymap.set({ "n", "v" }, lk.database.key .. "x", "<Plug>(DBUI_ExecuteQuery)", { desc = "Run Query" })
    end,
  },
}

so I'm wondering if theres something that has gone wrong here?

autoload/db_ui/drawer.vim

<img width="569" height="356" alt="Image" src="https://github.com/user-attachments/assets/3b5fcaa5-cc95-4fb8-8e8a-fe1bc36888d2" />

function! s:drawer.populate_schemas(db) abort
  let a:db.schemas.list = []
  if empty(a:db.conn)
    return a:db
  endif
  let scheme = db_ui#schemas#get(a:db.scheme)
  let schemas = scheme.parse_results(db_ui#schemas#query(a:db, scheme, scheme.schemes_query), 1)
  let tables = scheme.parse_results(db_ui#schemas#query(a:db, scheme, scheme.schemes_tables_query), 2)
  let schemas = filter(schemas, {i, v -> !self._is_schema_ignored(v)})
  let tables_by_schema = {}
  for [scheme_name, table] in tables
    if self._is_schema_ignored(scheme_name)
      continue
    endif
    if !has_key(tables_by_schema, scheme_name)
      let tables_by_schema[scheme_name] = []
    endif
    call add(tables_by_schema[scheme_name], table)
    call add(a:db.tables.list, table)
  endfor
  let a:db.schemas.list = schemas
  for schema in schemas
    if !has_key(a:db.schemas.items, schema)
      let a:db.schemas.items[schema] = {
            \ 'expanded': 0,
            \ 'tables': {
            \   'expanded': 1,
            \   'list': [],
            \   'items': {},
            \ },
            \ }

    endif
    let a:db.schemas.items[schema].tables.list = sort(get(tables_by_schema, schema, []))
    call self.populate_table_items(a:db.schemas.items[schema].tables)
  endfor
  return a:db
endfunction

Or does my config just suck??

Please let me know this is driving me crazy 🤣

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions