Skip to content

Refactor schemas for postgres #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 23, 2024
Merged

Refactor schemas for postgres #226

merged 11 commits into from
Aug 23, 2024

Conversation

tbantle22
Copy link
Collaborator

@tbantle22 tbantle22 commented Aug 20, 2024

This changes how we handle the hierarchy of postgres schemas. Before for postgres databases each connection could only handle one database and the database could not be changed (because postgres does not have use [db] queries and changing the database requires changing the connection). So to simplify changes to support postgres we essentially just equated mysql databases with postgres schemas. This worked fine enough for postgres, but once we started working on doltgres, the synonym started to fail since branches are per-database and not per-schema.

This PR has a few changes to accommodate the above:

  1. Move the schemas selector to the table nav below the branches selector. We now have to pass around the schemaName to different pages, which accounts for a lot of the changes
  2. Allow changing the database from the top nav (this destroys/recreates a connection with the new database)
  3. Postgres tables have the schema qualifier (i.e. the table name is schema.table instead of just table)
  4. Rename the Schemas tab to Definitions to avoid two "schema" titles that mean different things

The new UI looks like this:
Screenshot 2024-08-22 at 3 34 52 PM

This will not work for doltgres databases yet, just postgres. That's coming next

@tbantle22 tbantle22 force-pushed the taylor/pg-schema branch 3 times, most recently from 1e31193 to ba6512c Compare August 21, 2024 21:42
@tbantle22 tbantle22 marked this pull request as ready for review August 22, 2024 22:53
@tbantle22 tbantle22 requested a review from liuliu-dev August 22, 2024 23:00
Copy link
Contributor

@liuliu-dev liuliu-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@tbantle22 tbantle22 merged commit 1f331c3 into main Aug 23, 2024
2 checks passed
@tbantle22 tbantle22 deleted the taylor/pg-schema branch August 23, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants