-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
Empty variables should show in \raw
.
For example, currently usql
produces the following output:
(not connected)=> \set a ''
(not connected)=> select :a
(not connected)-> \p
select
(not connected)-> \raw
select
(not connected)->
However, on the \raw
above, it should have shown:
(not connected)-> \raw
select :a
(not connected)->
Comparatively:
(not connected)=> \set a b
(not connected)=> select :a
(not connected)-> \p
select b
(not connected)-> \raw
select :a
(not connected)->
And, it behaves as expected for quoted variables:
(not connected)=> \set a ''
(not connected)=> select :'a'
(not connected)-> \p
select ''
(not connected)-> \raw
select :'a'
(not connected)->
It's worth noting this is not dependent on the length of the variable name:
(not connected)=> select :aa
(not connected)-> \p
select
(not connected)-> \raw
select
(not connected)->
The reason for this behavior is partly due to the original way that variables were parsed and interpolated (at time of entry). This will require a slight overhaul to how variables are captured and interpolated.