We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, long queries block the editor If we're on neovim or vim 8, use async, otherwise block as normal.
The text was updated successfully, but these errors were encountered:
An attempt
function! mysql#GetResultsFromQuery(command) let user = g:sqh_connections[g:sqh_connection]['user'] let password = g:sqh_connections[g:sqh_connection]['password'] let host = g:sqh_connections[g:sqh_connection]['host'] let connection_details = 'mysql --unbuffered -u' . user . ' -p' . password . ' -h' . host let system_command = connection_details . " --table -e '" . a:command . "'" let async_is_ok = has('job') && has ('channel') || has('nvim') if async_is_ok let query_results = jobstart(system_command, extend({'shell': 'shell 1'}, {'on_stdout': function('mysql#AsyncReturnQueryResultsCallback'), 'stdout_buffered' :v:true})) else let query_results = system(system_command) return query_results endif endfunction function! mysql#AsyncReturnQueryResultsCallback(id, data, event) dict call sqhell#InsertResultsToNewBufferAsync('SQHUnspecified', a:data) endfunction
function! sqhell#InsertResultsToNewBufferAsync(local_filetype, query_results) call nvim_buf_set_lines(sqhell#GetResultsBuffer(), -2, -1, v:true, a:query_results) "Remove mysql junk" "this should probably go into the ftplugin on BufReadPre " normal gg2dd " setlocal buftype=nofile " setlocal bufhidden=hide " setlocal noswapfile setlocal nowrap " execute 'setlocal filetype=' . a:local_filetype endfunction function! sqhell#GetResultsBuffer() let buffers = filter(range(1, bufnr("$")), 'bufexists(v:val)') for buffer in buffers if bufname(buffer) ==? '_sq_' return buffer endif endfor endfunction
Sorry, something went wrong.
Before this we should probably do the one buffer for all results idea.
No branches or pull requests
Currently, long queries block the editor
If we're on neovim or vim 8, use async, otherwise block as normal.
The text was updated successfully, but these errors were encountered: