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
The code doesn't report an error when the libsql server is unavailable. When I attempt to perform database queries, I encounter the following error message:
2023/11/16 20:22:23 <nil> failed to execute SQL: SELECT * FROM user
Post "http://127.0.0.1:8080/v2/pipeline": dial tcp 127.0.0.1:8080: connect: connection refused
I would expect the code to return an error message indicating that the libsql server is unavailable instead of silently failing.
funcInitializeDB() (*sql.DB, error) {
db, err:=sql.Open("libsql", DB_URL)
iferr!=nil {
returnnil, fmt.Errorf("failed to open db %s: %w", DB_URL, err)
}
err=db.Ping()
iferr!=nil {
returnnil, fmt.Errorf("failed to ping database: %w", err)
}
returndb, nil
}