tursodatabase / turso-cli

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

db shell <db name> gets confused when it has wrong password #86

Closed haaawk closed 1 year ago

haaawk commented 1 year ago

When I changed a password to a db and then connected to it using db shell, it seemed to connect correctly but then wasn't able to execute any statement:

turso db shell test
Connected to test at https://haaawk:7l1845SpxYo69Dv0@iku-turso-c9169bdc-9d61-11ed-bd0d-acde48001122-primary.fly.dev

Welcome to Turso SQL shell!

Type ".quit" to exit the shell.

→  select * from sqlite_master;
error: Failed to execute SQL statement select * from sqlite_master;
→  create table test(int a);
error: Failed to execute SQL statement create table test(int a);
→  .quit

This can happen in two ways:

  1. Turso CLI settings got corrupted / edited
  2. DB password was changed

I think db shell should recognise that the connection wasn't successful, inform user and exit.

CodingDoug commented 1 year ago

The underlying error message coming from sqld is currently being masked by the CLI as described in #62.