-
Notifications
You must be signed in to change notification settings - Fork 344
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
Support for views #453
Comments
Hi, That's a good observation. I have never used views myself. Would you want to create the view programmatically? Or would you want to define it in the DDL? Thanks, |
I rarely use them myself, but it just so happened that I found a use for one. (It shows sums of values from some records) I was just thinking about having it in the DDL, just like the tables right now. |
I played with the idea earlier today, see https://github.com/rbock/sqlpp11/tree/feature-view. I guess the most difficult part will be parsing the DDL and creating the correct type structure from it. Note that sqlpp11 supports sub-queries. In my probably naive understanding of views that is kinda similar since you can store the sub-query in a variable and use it like a virtual table. |
Yeah, I managed to use subqueries to do the same thing and was impressed when it all just worked as I hoped it would. (Then I discovered I also need |
Assuming that the arguments of |
Interestingly, it appears you can mix types in I might look into implementing it (at least in the more limited version, assuming the same type for all arguments) over the weekend. |
Looking forward to it. Let me know if you need help. |
I started using the library just recently and I like it a lot, but I quickly noticed there is no support whatsoever for views. Are there any plans for changing that?
SQLite makes things a bit easier since views are read-only:
From what I gathered (some) other engines allow inserting through views but even then a read-only implementation would be very helpful.
The text was updated successfully, but these errors were encountered: