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

Models that can be ignored by migration scripts (Support for views) #15719

Closed
kings1ay3r opened this issue Oct 9, 2022 · 3 comments
Closed
Labels
kind/feature A request for a new feature. team/client Issue for team Client. team/psl-wg team/schema Issue for team Schema. topic: schema topic: views

Comments

@kings1ay3r
Copy link

Problem

The lack of support for database views have already been discussed for quite long, and various work arounds have also been suggested in those discussions. The project I work on extensively uses views to roll-up data & the task of managing them, everytime there is a migration is frustrating and error prone.

Suggested solution

Add support for viewModel or an annotation like @view or @ignore in the schema file so that the migrate script can create a view instead of a table/relationship using the corresponding syntax for the target DBMS where supported or throw an error if views arent supported. Client generation can generate only read methods / keep the other methods unexported. view defenitions can take references and aggregate methods.

Alternatives

View defenitions can be done by manually editing the migration sql.

@Jolg42 Jolg42 added team/schema Issue for team Schema. team/client Issue for team Client. team/psl-wg topic: views kind/feature A request for a new feature. labels Oct 10, 2022
@Jolg42
Copy link
Member

Jolg42 commented Oct 10, 2022

Note: relevant issue about supporting database views #678

@TasinIshmam
Copy link

TasinIshmam commented Nov 7, 2022

Hi folks, Tasin from the Prisma team here 👋

We know you are waiting for database views to land in Prisma.

As you might have seen, this is currently a candidate feature on our roadmap for the Prisma ORM. At this point in time, we can't really give an estimate of when this feature will be available on the ORM.

That being said: Another team at Prisma is working on solving this problem in different ways (beyond the Prisma ORM) — especially for users of sererless environments.

To figure out what exactly you, our users, are looking for, we launched a Design Partner Program where we collaborate closely with external teams to dive deep into their problems.

If you’re struggling with database views, especially in a serverless environment, you might be a great fit for this program!

You can check out the program in more detail to see the kinds of activities we’re planning. To apply to this program, fill out the application form.

We’re looking forward to hearing from you!

@janpio
Copy link
Member

janpio commented Jan 31, 2023

This is now obsolete as we implemented a new view keyword behind that views preview feature, which is ignored in Migrations. Read more via the links in our preview feature feedback issue for Views: #17335

@janpio janpio closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. team/client Issue for team Client. team/psl-wg team/schema Issue for team Schema. topic: schema topic: views
Projects
None yet
Development

No branches or pull requests

4 participants