vim-dadbod-completion icon indicating copy to clipboard operation
vim-dadbod-completion copied to clipboard

Deprecated

Open SingularisArt opened this issue 1 year ago • 8 comments

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",
    },
  },
...

SingularisArt avatar Aug 03 '23 21:08 SingularisArt

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

kristijanhusak avatar Aug 04 '23 07:08 kristijanhusak

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.

SingularisArt avatar Aug 04 '23 22:08 SingularisArt

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.

kristijanhusak avatar Aug 05 '23 09:08 kristijanhusak

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

SingularisArt avatar Aug 25 '23 04:08 SingularisArt

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.

stale[bot] avatar Dec 15 '23 04:12 stale[bot]

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

kristijanhusak avatar Dec 15 '23 06:12 kristijanhusak

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.

stale[bot] avatar Mar 13 '24 09:03 stale[bot]

Is this issue now solved?

kristijanhusak avatar Mar 13 '24 20:03 kristijanhusak