mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

The Database page should display an error when connection is invalid

Open pavish opened this issue 1 year ago • 2 comments

Description

  • Add an invalid connection (eg., wrong host, port). Notice that the connection gets added.
  • Open the database page. eg., http://localhost:8000/db/57/.
  • Notice that the page displays Schemas (0), instead of displaying an error to the user.
  • This is because the schemas endpoint filters by connection_id /api/db/v0/schemas/?connection_id=57, and returns: {"count":0,"results":[]}.

Expected behavior

  • The database page should show an error mentioning that the connection failed.
  • This might require both frontend and backend changes.

pavish avatar Dec 22 '23 09:12 pavish

This seems to be by design, please read the issue description for #3348 and https://github.com/mathesar-foundation/mathesar/pull/3348#issuecomment-1865542751

I think we need more discussions on this behaviour.

Anish9901 avatar Dec 22 '23 14:12 Anish9901

We discussed this in a maintainers meeting today.

  • Brent: We have an architectural problem causing this bug. This is why we see "Schemas (0)". There are 0 schema models associated with that connections model.
  • Sean: is it possible to connect to a DB successfully without seeing any schemas? — yes. There are even some scenarios in which you can't see the public schema.
  • Brent: This behavior is going to be completely changed when we don't have a schema model. In the new architecture this will be different.
  • This is not a release-blocker for v0.1.4 though, so we'll move it into a later milestone.

seancolsen avatar Jan 03 '24 17:01 seancolsen