-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Description
Using litecli version 1.10.1, installed with pipx on linux; base python is a pyenv-installed 3.10.10.
Given the following contents of ~/.config/litecli/config
:
[startup_commands]
commands = ".tables"
loading litecli fails:
.
Could not execute all startup commands:
Not connected to database.
(none)>
If the config is changed to add a trailing comma:
[startup_commands]
commands = ".tables",
then the .tables
command is correctly executed.
I suspect this is because without the comma, python is iterating the over the string ".tables"
, not the list [".tables",]
:
Lines 591 to 596 in 9d5bcf0
for command in self.startup_commands["commands"]: | |
try: | |
res = sqlexecute.run(command) | |
except Exception as e: | |
click.echo(command) | |
self.echo(str(e), err=True, fg="red") |
Adding a print above L592 confirms.
Without a comma:
self.startup_commands={'commands': '.tables'}
With a comma:
self.startup_commands={'commands': ['.tables']}
Metadata
Metadata
Assignees
Labels
No labels