tursodatabase / turso-cli

Command line interface to Turso.
https://turso.tech
MIT License
229 stars 37 forks source link

DB created through UI will require explicit update of the CLI cache #886

Open sivukhin opened 4 months ago

sivukhin commented 4 months ago

Context

turso-cli caches DB list and use it for some commands, for example db shell. This can lead to slightly confusing behaviour, if DB was created from UI, as CLI will report that database is not found. For example:

$> turso db shell ui-db # ui-db created from the ui
Error: database ui-db not found. List known databases using turso db list
$> turso db shell libsql://ui-db-sivukhin.turso.io # note, that if user will connect through URL - turso will not suggest any command to him
Error: could not find a database with the hostname ui-db-sivukhin.turso.io
$> turso db list # after this call - we can finally connect to ui-db through CLI

It's better to refresh cache once if DB was not found or at least improve error messages (for example, shell connection through URL doesn't mention any helpful commands like turso db list)