Closed CodingDoug closed 1 year ago
FYI @luisfvieirasilva
this is the reason:
func databaseFromURL(dbURL string, client *turso.Client) (*turso.Database, error) {
parsed, err := url.ParseRequestURI(dbURL)
if err != nil {
return nil, err
}
dbs, err := client.Databases.List()
if err != nil {
return nil, err
}
for _, db := range dbs {
if strings.HasSuffix(parsed.Hostname(), db.Hostname) {
return &db, nil
}
}
return nil, fmt.Errorf("hostname '%s' not found", parsed.Hostname())
}
We always try to map a URL to a database, we shouldn't do that for obvious reasons (localhost)
I'm pretty certain that the shell used to work with sqld running locally, but it no longer does. This might have broken with #419. This was a great feature to have, and will be important also to work with
turso dev
in the future (see #435).