usql icon indicating copy to clipboard operation
usql copied to clipboard

Allow -W with -o

Open dosy4ev opened this issue 4 years ago • 1 comments

It would be great to ask for password before output redirection. Current behavior is to raise error: password not available error.

dosy4ev avatar May 04 '21 13:05 dosy4ev

Are you also using -c or -f? Those flags would also disable the password prompt. As well as reading from stdin. Looks like there's no way to mix non-interactive and interactive modes. You have to add your password to ~/.usqlpass.

If you do want an interactive mode, you have to use the \o command.

Changing this behavior would have other side effects. As of now, we initialize readline with the output file before using it to prompt for a password: https://github.com/xo/usql/blob/master/main.go#L107 We could instead only set the output in the handler, but doing this would change the behavior of includes (\i command) and possibly others.

nineinchnick avatar May 05 '21 06:05 nineinchnick