You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect the .once command to work more than once in a session, each time resulting in the next query output to be written to a designated file.
Instead, you can use .once just once in a session. After that you have to restart litecli. It doesn't matter what the arguments are; executing .once a second time in the same session has no effect.
With written_to_once_file set to True, the next time you execute .once, the set_once() command still sets once_file, but immediately afterwards, unset_once_if_written() is executed after the command completes, which sets once_file back to None, so by the time your next output-producing command is run, nothing will be written out to the file.
The text was updated successfully, but these errors were encountered:
I can confirm that changing unset_once_if_written to:
@exportdefunset_once_if_written():
"""Unset the once file, if it has been written to."""globalonce_file, written_to_once_fileifwritten_to_once_file:
once_file=written_to_once_file=None
fixes the issue. Clearing written_to_once_file makes sure that the trigger doesn't fire forever for later commands.
I expect the
.once
command to work more than once in a session, each time resulting in the next query output to be written to a designated file.Instead, you can use
.once
just once in a session. After that you have to restart litecli. It doesn't matter what the arguments are; executing.once
a second time in the same session has no effect.This is caused by the
written_to_once_file
flag; it is set toTrue
when output is sent to a file, but then never set back toFalse
.With
written_to_once_file
set toTrue
, the next time you execute.once
, theset_once()
command still setsonce_file
, but immediately afterwards,unset_once_if_written()
is executed after the command completes, which setsonce_file
back toNone
, so by the time your next output-producing command is run, nothing will be written out to the file.The text was updated successfully, but these errors were encountered: