sql-language-server
sql-language-server copied to clipboard
how to solve Error NO_RESULT_CALLBACK_FOUND
When I open nvim to a .sql
file, I get the following error:
LSP[sqlls]: Error NO_RESULT_CALLBACK_FOUND: {
id = 1,
jsonrpc = "2.0",
result = {
capabilities = {
codeActionProvider = true,
completionProvider = {
resolveProvider = true,
triggerCharacters = { "." }
},
executeCommandProvider = {
commands = { "sqlLanguageServer.switchDatabaseConnection", "sqlLanguageServer.fixAllFixable
Problems" }
},
renameProvider = true,
textDocumentSync = 1
}
}
I suspect it is related to connecting to my db? (seems like the easiest place for things to go wrong?)
I have the following project configuration located in the project root (I don't have a personal config):
{
"name": "dev-db",
"adapter": "postgres",
"host": "db-postgresql-ondigitalocean.com",
"port": 25060,
"database": "db_v2",
"user": "admin",
"password": "secret",
"sslmode": "require"
}
Note the sslmode
is not documented, but is used to connect to digital ocean.
Question
What does the above error suggest for how to solve it?
Thank you!
I'm also getting this error, did you ever figure out how to solve this? @EdmundsEcho
@keyboard-clacker Paused the idea of using it... the feature/plugin seems useful but beyond the "risk benefit" ratio for getting it to work :( I went with having a pdf of the db schema displayed nearby; works every time :))
Hahah fair enough @EdmundsEcho
I just have the same problem and I spent a lot of hours trying to find the way to resolve it in the documentation. And then, I find this issue hahahaha ):
Got that Problem too.
Did install sqlls via williamboman/nvim-lsp-installer. I really tried the minimal configuration with a Project configuration file, but no success.
{
"name": "local_project_config",
"adapter": "postgres",
"host": "localhost",
"port": 5432,
"user": "its_me",
"database": "db_its_me"
}
Afterwards, I tried to config the neovim/nvim-lspconfig, but no success
require('lspconfig')['sqlls'].setup({
-- LSP-default-keymaps
on_attach = on_attach,
flags = lsp_flags,
-- languageserver = {
-- sql = {
-- cmd = { "sql-language-server", "up", "--method", "stdio" },
-- filetypes = { "sql", "mysql" },
-- settings = {
-- -- sqlLanguageServer = {
-- -- connections =
-- -- {
-- -- name = "local_project_config",
-- -- adapter = "postgres",
-- -- host = "localhost",
-- -- port = 5432,
-- -- user = "its_me",
-- -- database = "db_its_me"
-- --
-- -- -- name = "mysql_project",
-- -- -- adapter = "mysql",
-- -- -- host = "127.0.0.1",
-- -- -- port = 3306,
-- -- -- user = "sqlls",
-- -- -- password = "sqlls",
-- -- -- database = "mysql_db",
-- -- -- -- projectPaths = ["/Users/joe_re/src/MysqlProject"],
-- -- -- ssh = {
-- -- -- user = "ubuntu",
-- -- -- remoteHost = "xxx-xx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com",
-- -- -- dbHost = "127.0.0.1",
-- -- -- port = 3306
-- -- -- }
-- -- },
-- -- -- lint = {
-- -- -- rules = {
-- -- -- align-column-to-the-first = "error",
-- -- -- column-new-line = "error",
-- -- -- linebreak-after-clause-keyword = "off",
-- -- -- reserved-word-case = ["error", "upper"],
-- -- -- space-surrounding-operators = "error",
-- -- -- where-clause-new-line = "error",
-- -- -- align-where-clause-to-the-first = "error"
-- -- -- }
-- -- -- }
-- -- }
-- }
-- -- }
-- -- }
})
But there is one thing, where it should work in the minimal config:
If you enter psql
, you can switch to your default editor (neovim) with \e
. But there is not happening anything, none the keyboard-shortcuts of the neovim/nvim-lspconfig are working (like formatting).
In this case, the adapter-configuration must be set globally and not in a project dir. Or is there another way?
Got that Problem too.
I have this problem too
me too, I've got the following log:
[WARN][2022-09-29 23:18:23] .../lua/vim/lsp.lua:812 "server_request: no handler found for" "workspace/diagnostic/refresh"
[WARN][2022-09-29 23:18:23] .../lua/vim/lsp.lua:812 "server_request: no handler found for" "workspace/diagnostic/refresh"
[START][2022-09-29 23:17:15] LSP logging initiated
[START][2022-09-29 23:23:29] LSP logging initiated
[START][2022-09-29 23:28:26] LSP logging initiated
[ERROR][2022-09-29 23:28:27] .../vim/lsp/rpc.lua:534 "No callback found for server response id 1"
[ERROR][2022-09-29 23:28:27] .../lua/vim/lsp.lua:824 "LSP[sqlls]" "on_error" { code = "NO_RESULT_CALLBACK_FOUND", err = { id = 1, jsonrpc = "2.0", result = { capabilities = { codeActionProvider = true, completionProvider = { resolveProvider = true, triggerCharacters = { "." } }, executeCommandProvider = { commands = { "sqlLanguageServer.switchDatabaseConnection", "sqlLanguageServer.fixAllFixableProblems" } }, renameProvider = true, textDocumentSync = 1 } } }}
aparently it's correctly configurated but something is not working properly.
Same issue here
Same story here.
Same here!
Same here
Same.
bump
At the moment there are no solutions to this problem?
At the moment there are no solutions to this problem?
See @timabdulla, he pointed out the underlying cause and his pull request is still in queue (https://github.com/joe-re/sql-language-server/pull/150).
Hi, all. Sorry for our late response. We've released a new version(v1.13.1) and the problem should be fixed. Please update sql-language-server to the latest and try again. Thanks.