{"action":"created","issue":{"url":"https://api.github.com/repos/tpope/vim-dadbod/issues/11","repository_url":"https://api.github.com/repos/tpope/vim-dadbod","labels_url":"https://api.github.com/repos/tpope/vim-dadbod/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/tpope/vim-dadbod/issues/11/comments","events_url":"https://api.github.com/repos/tpope/vim-dadbod/issues/11/events","html_url":"https://github.com/tpope/vim-dadbod/issues/11","id":303668040,"number":11,"title":"Unable to execute statements","user":{"login":"x4121","id":516123,"avatar_url":"https://avatars0.githubusercontent.com/u/516123?v=4","gravatar_id":"","url":"https://api.github.com/users/x4121","html_url":"https://github.com/x4121","followers_url":"https://api.github.com/users/x4121/followers","following_url":"https://api.github.com/users/x4121/following{/other_user}","gists_url":"https://api.github.com/users/x4121/gists{/gist_id}","starred_url":"https://api.github.com/users/x4121/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x4121/subscriptions","organizations_url":"https://api.github.com/users/x4121/orgs","repos_url":"https://api.github.com/users/x4121/repos","events_url":"https://api.github.com/users/x4121/events{/privacy}","received_events_url":"https://api.github.com/users/x4121/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-03-08T23:17:35Z","updated_at":"2018-03-15T21:08:36Z","closed_at":"2018-03-15T19:34:47Z","author_association":"NONE","body":"Whenever I try to execute a sql statement (with `:{range}DB [url]` or `:DB [url] {cmd}`), I get:\r\n\r\n```\r\nError detected while processing function db#execute_command:\r\nline   66:\r\nE484: Can't open file /tmp/vMjw0en/5.dbout\r\n```\r\nThe mentioned file does not exist, only a $i.sql (where $i is the number of the missing file) with the statement to be executed.\r\n\r\nJust running `:DB g:bar = mysql:me@myhost` seems to work fine (using the variable later on doesn't).\r\nConnection with the mysql client works fine, executing the statements there as well.\r\n\r\nedit: same is happening for PostgreSQL\r\nedit2: also happening inside \"clean\" ubuntu:artful Docker container with only vim, git, postgresql-client and the plugin installed\r\nedit3: forgot to mention, statement for testing was `:DB mysql://user:password@host.tld/db-name select count(*) from some-table`"},"comment":{"url":"https://api.github.com/repos/tpope/vim-dadbod/issues/comments/373523429","html_url":"https://github.com/tpope/vim-dadbod/issues/11#issuecomment-373523429","issue_url":"https://api.github.com/repos/tpope/vim-dadbod/issues/11","id":373523429,"user":{"login":"rike09","id":2717448,"avatar_url":"https://avatars1.githubusercontent.com/u/2717448?v=4","gravatar_id":"","url":"https://api.github.com/users/rike09","html_url":"https://github.com/rike09","followers_url":"https://api.github.com/users/rike09/followers","following_url":"https://api.github.com/users/rike09/following{/other_user}","gists_url":"https://api.github.com/users/rike09/gists{/gist_id}","starred_url":"https://api.github.com/users/rike09/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rike09/subscriptions","organizations_url":"https://api.github.com/users/rike09/orgs","repos_url":"https://api.github.com/users/rike09/repos","events_url":"https://api.github.com/users/rike09/events{/privacy}","received_events_url":"https://api.github.com/users/rike09/received_events","type":"User","site_admin":false},"created_at":"2018-03-15T21:08:36Z","updated_at":"2018-03-15T21:08:36Z","author_association":"NONE","body":"It still doesn't work for me...\r\n\r\nMore details:\r\nI am using postgresql. Echoing the command to be executed in vimscript, I get:\r\n\r\n`psql -w \"postgresql://user:password@localhost:5432/db\" -P columns=120 -v ON_ERROR_STOP=1 -f - < \"C:\\Users\\User\\AppData\\Local\\Temp\\VIA4712.tmp.sql\" > C:\\Users\\User\\AppData\\Local\\Temp\\VIA4712.tmp.dbout 2>&1`\r\n\r\nIf I execute this straight in the command line, it works.\r\nIf I execute this in vim with :! ... it works.\r\nI couldn't find a way to execute it with :call system(...)\r\n\r\nWhen I execute with :! the shell that pops up shows this:\r\n`C:\\Windows\\system32\\cmd.exe /c (psql -w ^\"postgresql://user:password^@localhost:5432/db^\" -P columns=120 -v ON_ERROR_STOP=1 -f - ^< ^\"C:\\Users\\User\\AppData\\Local\\Temp\\VIA4712.tmp.sql^\" ^> C:\\Users\\User\\AppData\\Local\\Temp\\VIA4712.tmp.dbout 2^>^&1)`\r\n\r\nExecuting `:DB postgresql://user:password^@localhost:5432/db select count(*) from schema.table` still gives the error."}}
{"actor":{"display_login":"rike09"}}