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

Modify API to make explorations aware of their associated schema #3880

Closed
seancolsen opened this issue Sep 25, 2024 · 0 comments · Fixed by #3892
Closed

Modify API to make explorations aware of their associated schema #3880

seancolsen opened this issue Sep 25, 2024 · 0 comments · Fixed by #3892
Assignees
Labels
ready Ready for implementation restricted: maintainers Only maintainers can resolve this issue work: backend Related to Python, Django, and simple SQL

Comments

@seancolsen
Copy link
Contributor

seancolsen commented Sep 25, 2024

Context

  1. In the UI, each exploration is associated with one schema by virtue of being presented "within" a schema.
  2. In Mathesar 0.1.7, that association was handled by virtue of each Exploration referring to a Table which then referred to a Schema. All of those associations were contained within the internal database.
  3. Mathesar 0.2 onwards no longer has that Table model. Each exploration weakly references a table oid in the user database. And we need to look inside the user database to see what schema that table lives within.
  4. The change in data model presents a small problem, given our current UX.
  5. At some meeting a few months ago we had decided to solve this problem within the front end. The front end would fetch all the explorations for a database and then filter them out.
  6. However, now that I'm in the code I can see that taking that approach will require significant front end refactoring. Pavish and I had a call about this today and decided that it would be best to solve this problem in the service layer instead of in the front end.

Changes needed

Here's what we'd like:

  • explorations.list

    • Add an optional schema_oid parameter to filter the list of explorations by schema.

    • Modify return value to include a schema_oid property.

  • explorations.get

    • Modify return value to include a schema_oid property.
  • explorations.add

    • Modify return value to include a schema_oid property.

To handle these changes, the service layer would need to call out to the user database for these two RPC methods.

@seancolsen seancolsen added ready Ready for implementation restricted: maintainers Only maintainers can resolve this issue type: enhancement work: backend Related to Python, Django, and simple SQL labels Sep 25, 2024
@seancolsen seancolsen added this to the v0.2.0-testing.1 milestone Sep 25, 2024
@seancolsen seancolsen self-assigned this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation restricted: maintainers Only maintainers can resolve this issue work: backend Related to Python, Django, and simple SQL
Projects
None yet
1 participant