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

Query Builder and Views design #442

Closed
11 of 13 tasks
kgodey opened this issue Jul 19, 2021 · 4 comments
Closed
11 of 13 tasks

Query Builder and Views design #442

kgodey opened this issue Jul 19, 2021 · 4 comments
Labels
pr-status: revision A PR awaiting follow-up work from its author after review type: meta List of related issues. Not meant to be worked on directly.
Milestone

Comments

@kgodey
Copy link
Contributor

kgodey commented Jul 19, 2021

@kgodey kgodey added status: detail needed type: meta List of related issues. Not meant to be worked on directly. labels Jul 19, 2021
@kgodey kgodey added this to the 08. Working with Views milestone Jul 19, 2021
@kgodey kgodey added ready Ready for implementation and removed status: detail needed labels Jul 21, 2021
@mathemancer
Copy link
Contributor

mathemancer commented Jul 28, 2021

@kgodey
Continuing the conversation from #471 :

One problem is going to be that if the purpose for having views is to be able to put a table back together that's been normalized into its constituent atoms, this will fall outside of what PostgreSQL will be able to deal with automatically, w.r.t. editing records. Note from the docs:

  • The view must have exactly one entry in its FROM list, which must be a table or another updatable view.

This means we won't be able to compose an automatically-updatable view from multiple tables. We would be able to compose one from a select on a single table under some circumstances. Off the top of my head, some uses for which this makes sense are:

  • hiding columns,
  • reordering columns (i.e., changing the column order, not the record order),
  • renaming columns without renaming the underlying data columns,
  • changing the type of the columns without changing the underlying type
    • suppose you want to see a given REAL column without the digits after the decimal point, but don't want to actually remove those digits in the underlying data. You could create a view where that column is an INTEGER.

@kgodey
Copy link
Contributor Author

kgodey commented Jul 28, 2021

@mathemancer That makes sense. I'd like us to build out the product a little more before we decide whether we need to provide functionality to update views that don't meet the PostgreSQL definition of updatable. I'll create an issue for it but put it in "future" for now. We can reevaluate when to schedule it in a few weeks.

Edited to add:

@mathemancer
Copy link
Contributor

Another quick note about views: When implementing, note that they do have OIDs (and are available the same way as tables in the pg_catalog.pg_class system catalog table). So, the implementer setting up the views could probably create a model similar to the Table model, using the same id -- oid mapping.

@kgodey kgodey self-assigned this Oct 30, 2021
@kgodey kgodey added status: draft and removed ready Ready for implementation labels Oct 30, 2021
@kgodey kgodey changed the title Working with Views Query Builder and Views design Mar 3, 2022
@kgodey kgodey added work: design pr-status: revision A PR awaiting follow-up work from its author after review and removed work: product labels Mar 7, 2022
@kgodey kgodey removed their assignment Mar 7, 2022
@kgodey kgodey modified the milestones: [09] Working with Views, Cycle 2 Jun 1, 2022
@kgodey kgodey modified the milestones: Cycle 2, Cycle 3 Jul 19, 2022
@kgodey
Copy link
Contributor Author

kgodey commented Jul 19, 2022

Although we are doing this feature in Cycle 3, this ticket no longer covers accurate design requirements, so I'm going to close it.

@kgodey kgodey closed this as completed Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: revision A PR awaiting follow-up work from its author after review type: meta List of related issues. Not meant to be worked on directly.
Projects
No open projects
Development

No branches or pull requests

2 participants