Closed rjbudzynski closed 3 months ago
@rjbudzynski this has been requested more than once, and I have an overhaul coming that will add this functionality. In the interim, you can use variables, and set them in your .usqlrc
:
$ cat ~/.usqlrc
\set MYURL postgres://user:pass@host
$ usql
Type "help" for help.
(not connected)=> \c :MYURL
error: pq: dial tcp: lookup host: no such host
(not connected)=> \echo :MYURL
postgres://user:pass@host
(not connected)=>
Thank you, very nice hint.
This is almost finished, and will be in the next major release.
This has been implemented.
It would be very convenient to be able to define an alias for the set of connection data (protocol. host, port, username, password, database) and connect via this alias instead of typing the whole deal every time. If I understand correctly, the .usqlpass functionality only allows one to omit the password.
Such functionality is for instance available in the similar "henplus" utility, written in java. But that one is old and no longer maintained, and I found usql when searching for a replacement.