-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support for creating a database view from scratch #781
Comments
@ghislaineguerin @pavish @mathemancer @seancolsen This issue has been updated and is ready for review. Please look through it and unassign yourself after you've added any feedback that you might have. |
Before I get deeper into formulating feedback, I have a question... Say I have the following schema: - address
- id
- addressee
- street
- city
- state
- zip_code
- shipment
- id
- origin (FK to address.id)
- destination (FK to address.id)
- priority_level
- departure_datetime
- arrival_datetime Will it be possible for me to create a view that displays this? SELECT
shipment.id,
origin.addressee,
destination.addressee
FROM shipment
JOIN address AS origin ON origin.id = shipment.origin
JOIN address AS destination ON destination.id = shipment.destination; I've crafted this example to have a view that meaningfully references the same column twice in two different ways. The proposed design reads:
That makes it seem to me as though the a set of columns (perhaps ordered) will comprise the entire input to the view creation. If that's true, I have many more follow-up thoughts -- but I want to make sure I understand the proposal correctly first. |
@seancolsen has a great example there. Many |
One idea would be to only be able to do very basic views through the described flow, and have more advanced views via:
So, for @seancolsen's example, you'd start from the shipments table, hover (or whatever) the destination foreign key column, and pick the addressee column from the addresses table. Then you'd hover (or whatever) the origin foreign key column, and pick the addressee column from the addresses table. I do think that when constructing a view, much more "column-oriented" thinking should be useful than when initially linking tables. (Though in the shipments example, you'd need it at both stages somewhat). Please don't take the example UI too literally. The point is just that it might make sense to interact with the foreign key column and choose available linked columns at that point. |
Instead of thinking in terms of adding columns from a linked table, I think we should think in terms of adding columns from a link i.e. treating the link as the primary input. i.e In the example @seancolsen provided, if the user tries creating the view from the address table instead of the shipments table, we could show 2 options like:
|
I like the idea of thinking in terms of adding columns from a link. I've updated the description. I do think it should be possible to reference the same column twice in different ways. |
Marking this as ready and moving to backlog. |
Although we are doing work related to this in Cycle 3, this ticket no longer covers accurate design requirements, so I'm going to close it. |
The Mathesar UI should allow users to create a new database view from scratch. The flow should be as follows:
Scenarios
Additional context
The text was updated successfully, but these errors were encountered: