tpope / vim-dadbod

dadbod.vim: Modern database interface for Vim
https://www.vim.org/scripts/script.php?script_id=5665
3.74k stars 131 forks source link

mysql: Fix socket connection when host default is not localhost #173

Closed dotdash closed 6 months ago

dotdash commented 6 months ago

The socket option of mysql only works when the hostname is set to localhost. As the mysql adapter doesn't set a hostname at all when a socket is given, this breaks when the default hostname has been set to something else than localhost, e.g. in a user's .my.cnf file. As one can't give both a hostname and a socket path at the same time, we can to simply force the hostname to localhost when a socket path is used to make things work again.