kristijanhusak / vim-dadbod-completion

Database autocompletion powered by https://github.com/tpope/vim-dadbod
MIT License
653 stars 27 forks source link

Deprecated #51

Open SingularisArt opened 1 year ago

SingularisArt commented 1 year ago

I don't know why I keep getting this error:

Error executing Lua callback: .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:45: function db_ui#find_buffer[25]..59[19]..FileType Autocomm ands for "mysql"..function vim_dadbod_completion#fetch[16]..<SNR>80_get_buffer_db_info[8]..db#connect, line 29: DB exec error: /usr/bin/mysql: Deprecat ed program name. It will be removed in a future release, use '/usr/bin/mariadb' instead stack traceback: [C]: in function 'cmd'
  .../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:45: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/core/handler/cmd.lua:16>

I'm using mariadb instead of MySQL. Here's my configuration:

...
  {
    "tpope/vim-dadbod",
    config = function()
      local function db_completion()
        require("cmp").setup.buffer { sources = { { name = "vim-dadbod-completion" } } }
      end

      vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"

      vim.api.nvim_create_autocmd("FileType", {
        pattern = {
          "sql",
        },
        command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
      })

      vim.api.nvim_create_autocmd("FileType", {
        pattern = {
          "sql",
          "mysql",
          "plsql",
        },
        callback = function()
          vim.schedule(db_completion)
        end,
      })
    end,
    cmd = { "DBUIToggle", "DBUI", "DBUIAddConnection", "DBUIFindBuffer", "DBUIRenameBuffer", "DBUILastQueryInfo" },
    dependencies = {
      "kristijanhusak/vim-dadbod-ui",
      "kristijanhusak/vim-dadbod-completion",
    },
  },
  {
    "nanotee/sqls.nvim",
    cmd = {
      "SqlsExecuteQuery",
      "SqlsExecuteQueryVertical",
      "SqlsShowDatabases",
      "SqlsShowSchemas",
      "SqlsShowConnections",
      "SqlsSwitchDatabase",
      "SqlsSwitchConnection",
    },
  },
...
kristijanhusak commented 1 year ago

Does your dadbod work fine? For example, try doing :DB select * from users when you are in the buffer.

SingularisArt commented 1 year ago

When I run that, I get the error: DB: no URL. Can you provide me with a link to a tutorial or something that goes over on how to set up neovim for SQL development? I used to use the SQLS language server, but after it was archived, all my development setup crashed.

Also, I have to use this fork because I keep getting the error saying that /usr/bin/mysql is deprecated. Use /urs/bin/mariadb instead.

kristijanhusak commented 1 year ago

Follow instructions on https://github.com/kristijanhusak/vim-dadbod-ui how to set up a connection, and when you start a new query from there it should set up everything for you.

SingularisArt commented 1 year ago

I got it working with this fork. But, in the DBUI view, it's not listing the columns. display

stale[bot] commented 11 months ago

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.

kristijanhusak commented 11 months ago

This should probably work out once https://github.com/tpope/vim-dadbod/pull/138 is merged

stale[bot] commented 8 months ago

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.

kristijanhusak commented 8 months ago

Is this issue now solved?