sqls
sqls copied to clipboard
"no database connection" on start when configuring by workspace/configuration
Describe the bug A clear and concise description of what the bug is.
I currently use workspace/configuration
instead of configuration files and the server is always emitting the "no database connection"
error message on start, but the server does works regardless.
To Reproduce Steps to reproduce the behavior:
- Use a
workspace/configuration
config. An example one I use to set coc.nvim in neovim 0.5 is:vim.fn['coc#config']('languageserver.sqls', { command = 'sqls', filetypes = { 'sql' }, settings = { sqls = { connections = { { driver = 'postgresql', dataSourceName = 'postgres://postgres@localhost/database?sslmode=disable' } } } } })
Expected behavior A clear and concise description of what you expected to happen.
I don't expect this message to show up.
Versions (please complete the following information):
- OS Version: Arch Linux
- sqls Version sqls Version:0.2.18, Revision:db8733f
Additional context Add any other context about the problem here.
I'm also having the same issue, however I'm using Neovim's LSP config instead of COC.
Me too, but I'm using lunarvim. This is the config that I setup with :LspSettings sqls
{
"settings": {
"sqls": {
"connections": [
{
"driver": "postgresql",
"proto": "unix",
"user": "postgres",
"passwd": "password",
"dbName": "omitted"
},
{
"driver": "postgresql",
"proto": "unix",
"user": "postgres",
"passwd": "password",
"dbName": "omittedAsWell"
}
]
}
}
}
I'm also having the same issue, however I'm using Neovim's LSP config instead of COC.
Me as well. :/
I had the same issue, and I fixed it by setting up the global config. It seems that it ignores all other methods. to fix create the config file on ~/.config/sqls/config.yml
:
# Set to true to use lowercase keywords instead of uppercase.
lowercaseKeywords: false
connections:
- alias: psql
driver: postgresql
dataSourceName: 'host=127.0.0.1 port=5432 user=postgres password=secret dbname=testdb sslmode=disable'
@Cih2001 That's what I ended up doing as well. The good thing though is that we don't save the credentials on VIM config files (which is tracked by git).
I did that as well but its not working for me, not only is still showing the same error message but also my db settings are not getting picked. I can only use sqls when setting workspace/configuration
As far as I looked the code of sqls, workspace/didChangeConfiguration should work.