Closed TheLeoP closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Today I finally try to solve this and I think I have found the solution. In Windows a filename can't contain colons (:
) and this plugin creates it's temporary query files with a structure similar to something-2022-09-26 18:13:00
. For some reason, Windows doesn't complain at Vim and let's it create the files normally, but when the argument is passed as a file name to the database executable (in my case psql.exe), it complains because of the colons in the filename. Could it be posible to replace the colons with another character? Should I open a PR doing it since it's a simple fix?
Edit: Ok, apparently the character used by this plugin isn't a color :
but rather the unicode character 2236 called ratio ∶
, that's why Windows wasn't complaining. My guess now is that the psql executable on Windows doesn't like character unicodes because it complains about the path not existing even when using just vim-dadbod
with the command :DB < path/to/file
where path/to/file
contains the ratio character.
Thanks for investigating. I updated it to use hyphens instead of space and colon, so this should hopefully fix the issue.
When I open a buffer, write a query and then save it, I get the following result:
But, if I modify the buffer, doesn't save it and use the command
:%DB
the query works as expected. Also, if I first save the buffer, the query fails and then I sue the command:%DB
, the query also fails with the same error.I was trying to dig into the code, but I don't really know nearly enought vimscript. Maybe the autocmd that is run on save is altering the buffer content in some way (?). I try using the dos and unix fileformat, but the result was the same.