Skip to content
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

Fix bug when updating table twice #3909

Merged
merged 1 commit into from
Oct 2, 2024
Merged

Conversation

seancolsen
Copy link
Contributor

@seancolsen seancolsen commented Oct 1, 2024

Fixes #3867
Fixes #3908

Notes

  • I think this bug was introduced in Reduces frontend caching, fixes a few bugs #3897

  • When reviewing that PR, the optional storage of databaseId and schemaOid within TablesData seemed a little weird to me, but I just went with it, especially since the PR seemed to be just in incremental refactor of an already messy module.

  • At some point when we have time, I'd like to see:

    • A TablesStore class which manages the storage of multiple tables within one schema. It would have:

      • A non-reactive back-reference to its containing Schema object.
      • A reactive map of tables.
      • Public methods for CRUD on tables.
    • A SchemaRouteContext class (similar to DatabaseRouteContext) which holds a TablesStore instance.

    That way, any time you have a SchemaRouteContext, you get everything you need. And when you don't have a SchemaRouteContext you don't get any of it. And all the tables CRUD would be nicely encapsulated into the TablesStore class.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@seancolsen seancolsen added this to the v0.2.0-testing.1 milestone Oct 1, 2024
@seancolsen seancolsen added the pr-status: review A PR awaiting review label Oct 1, 2024
@seancolsen seancolsen changed the title Fix bug when updating table name Fix bug when updating table Oct 1, 2024
@seancolsen seancolsen changed the title Fix bug when updating table Fix bug when updating table twice Oct 1, 2024
Copy link
Member

@pavish pavish left a comment

Choose a reason for hiding this comment

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

@seancolsen Nice! Looks good!

any time you have a SchemaRouteContext, you get everything you need. And when you don't have a SchemaRouteContext you don't get any of it

Yes, this is precisely how I had intended to structure the route contexts and list of objects they need. The DatabaseRouteContext will contain the SchemasStore, and the SchemaRouteContext will contain the TablesStore and the ExplorationsStore. This way we'll no longer have a need for imported stores.

For navigation purposes on the header, I'd expect the Route level components to set the stores in the breadcrumbs.

I decided to not go through with these changes in the recent model refactoring since we use the schemas, currentSchema, tables, and currentTables stores in several places and I didn't want to increase scope.

I think we can discuss this again when we have the bandwidth to make the changes.

@pavish pavish added this pull request to the merge queue Oct 2, 2024
Merged via the queue into develop with commit be8bc92 Oct 2, 2024
33 checks passed
@pavish pavish deleted the 3867_table_rename_bug_2 branch October 2, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: review A PR awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to drag columns after dragging one column Intermittent failure to display updated table name
2 participants