xo / usql

Universal command-line interface for SQL databases
MIT License
9.07k stars 352 forks source link

Invalid database scheme with `\copy` #495

Open bobvanderlinden opened 1 week ago

bobvanderlinden commented 1 week ago

When doing the following:

=> \cset MSSQL mssql://USER:PASS@HOST:PORT/DATABASE
=> \copy MSSQL csvq://. 'YYY'
error: invalid database scheme

Note that the following works fine:

=> \cset MSSQL mssql://USER:PASS@HOST:PORT/DATABASE
=> \c MSSQL

As does using copy without the connection variable:

=> \copy mssql://USER:PASS@HOST:PORT/DATABASE csvq://. 'YYY'

Somehow \copy handles connection variables differently from \c. What could be the issue?