sqlua.nvim icon indicating copy to clipboard operation
sqlua.nvim copied to clipboard

Doesn't work and I don't understand why

Open idk2me opened this issue 8 months ago • 3 comments

I installed the plugin via Lazy, not using any pre-packaged nvim, just my own config.

this is my sqlua.lua file:

return {
	{
		"xemptuous/sqlua.nvim",
		lazy = true,
		cmd = "SQLua",
		config = function()
			require("sqlua").setup()
		end,
	},
}

I added my connection string to connections.json like:

[{"url": "mysql://[user]:[password]@localhost:3306/[db]", "name": "mydb"}]

I get this error when selecting the database I want to work with in the tree Image

When trying to execute queries, I get:

E5108: Error executing lua: ...user/.local/share/nvim/lazy/sqlua.nvim/lua/sqlua/ui.lua:1359: attempt to index local 'db' (a nil value)
stack traceback:
        ...user/.local/share/nvim/lazy/sqlua.nvim/lua/sqlua/ui.lua:1359: in function <...user/.local/share/nvim/lazy/sqlua.nvim/lua/sqlua/ui.lua:1342>

Am I missing something or could this be an issue when running a DB in docker?

idk2me avatar May 18 '25 12:05 idk2me

I think the issue has to do with the MySQL base connector. I haven't implemented it properly it seems, as arch suggests and supports MariaDB as a replacement in general, so I may not have explicitly tested it. I can look into solving this.

In the meanwhile, try using mariadb in your connections.json instead of mysql and see if that works. I imagine they should be compatible ftmp

Xemptuous avatar May 26 '25 17:05 Xemptuous

I have this same issue for Snowflake; identical error code.

daltongarrettpayne avatar Sep 10 '25 17:09 daltongarrettpayne

I have this same error for mysql. Using mariadb instead does not raise the error but still does not work.

Pastells avatar Nov 25 '25 14:11 Pastells