-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Should we have a story for database views? #43
Comments
Hi, what is the status of this? Is there a way to support views? Is this in the roadmap?, thanks. |
@werner You can create your own schema for views manually (and keeping it in sync if you change your views) and it works. |
Hi! What are the technical challenges for diesel to automatically add views in the schema as it does with tables? |
@Razican Using
Based on this points I would assume that we would need a separate |
This has been open for 7 years, and there have been more than a couple other people open issues relating to this, is there any chance this feature is in the near future? |
@letto4135 The comment above remains valid. It's not on my priority list, so I do not plan to work on this in foreseeable future. That written: We accept contributions for this feature. I suggest you open a discussion with some design ideas first, before starting to implement something. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I want to start working on this. But I really don't know where to start. What could we consider a proof of concept? I was thinking a version where we completely disallow insert/update/delete, even in views that some DB (postgres for example) would allow it and consider all columns as nullable, to normalize any nullablebility inconsistencies (since we are only allowing reads, this wouldn't cause any errors on the DB side). And about the point you made about primary keys: why does Diesel require primary keys on tables in the first place? What would be the technical difficulties of implementing views, without said primary keys? The features described above would already be useful for a lot of people. From my experience views are mostly used as read only anyway. |
Started a discussion #3473 |
Do we need one? @derekprior you might have opinions on this. I was just thinking about this, and it might be cool (if we go the DSL migration route) to allow using the query builder DSL for constructing views, and then when the migration is run store the previous version in the
schema_migrations
table, to getdown
for free.The text was updated successfully, but these errors were encountered: