-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
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
Running query as multiple-line selection gives out error #56
Comments
@ichirou2910 does executing the whole buffer work? |
Yes it works fine |
Can you just give me the format of your connection url? For example:
|
|
OK thanks, I'll look into it. |
I'm not able to reproduce this. I'll need more info.
I found this regarding the error https://stackoverflow.com/questions/28452021/error-cant-initialize-batch-readline-may-be-the-input-source-is-a-directory But i can't figure out what's wrong. If you can, test this scenario and let me know if it works:
Does it work? |
@ichirou2910 I'll need you to test 2 more things:
Restart neovim and give it a test from start. This will create queries in that folder instead of using temp folder. It's really confusing that thing from previous comment ( Just try these 2 things and let me know how it goes. |
@ichirou2910 I added a debug mode in order to get some information around things that are happening in queries. Add |
@kristijanhusak |
@ichirou2910 I know, but I'm doing that for a reason, and vim-dadbod does the same thing internally. |
What happens when you try to execute the |
can you I just pushed a small change to add an extension to the temp name. Can you give it another try? |
That shouldn't be the issue, because dadbod does exactly same thing when executing queries https://github.com/tpope/vim-dadbod/blob/master/autoload/db.vim#L213 If you execute Can you try that and then manually execute that sql file generated by dadbod with same command ( |
Yeah, same :/ I'll need your help to debug it, since i can't reproduce it. First, pull latest changes. Then, open up the query buffer, and do first visual selection command Also, try executing that command directly from terminal to see what will happen. |
Mesages when use
Messages when use
Mesages when use
Mesages when use
And |
For some reason it is not properly figuring out the input file in some cases, and it defaults to home folder. Lets try this. Add this line: echom 'MAYBE INFILE '.string(maybe_infile) After this line https://github.com/tpope/vim-dadbod/blob/master/autoload/db.vim#L215 And give it another test. Let me know what it prints out for this line. |
Mesages when use
Messages when use
Mesages when use
Mesages when use
|
So confusing... Sorry for bothering you so much, but this is really strange. I'll need few more things:
echom 'INFILE BEFORE '.string(infile) And after line https://github.com/tpope/vim-dadbod/blob/master/autoload/db.vim#L260, add this: echom 'INFILE AFTER '.string(infile) and re-test it. |
The other cases I guess it's not important anymore |
Ok that's definitely the issue. It properly expands for me. |
|
@ichirou2910 and what about this: echo fnamemodify('/tmp/nvimkvRSfR/8.sql', ':p') I'm using latest neovim from master. Will try the stable version. |
|
I just tried same version, everything works fine. Do you have your tmp folder as a separate partition which you mount? Is it maybe a symlink? I found this regarding failed expand() calls chrisbra/SudoEdit.vim#17 (comment) What does It would be good if you could try this on a different version of neovim, or in vim. |
I pushed a fix. It uses dadbod's visual selection when available. We are still left with this issue, which should be fixed in vim-dadbod, so I would still appreciate if you could help me out on this. |
Does vim work without the fix, where it also do "Execute multiple lines" ? |
Sadly no, I rolled back 1 commit and tried, still got that error |
Did you add custom mapping for executing visual selection? |
No, I don't map any extra key for dadbod-ui |
Ok I'll check. |
I can't reproduce it :/ I did push small change, but it shouldn't affect this. Give it a try anyway. If the latest change doesn't work for you, join all lines that you are trying to execute into one line, separated by a space, and try executing this search:
Is it finding something? |
Great! :) Thanks for help in debugging. |
I found issue #30 about executing only selection as query, and while single line query works just fine, multiple-line doesn't seems to work and always throws out error as in the image.
ERROR: Can't initialize batch_readline - may be the input source is a directory or a block device.
It would be quite uncomfortable to move those lines to another query then execute them as a whole. Do you have any idea?
The text was updated successfully, but these errors were encountered: