You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just found this package and it looks super useful. One of the first things I did was to search the issues to see if there was any insight on how views are handled, and found this.
Is the DDL code given ever actually run in the database? If it's only used to generate the structs, would a valid workaround be:
And then design your queries of baz as normal, since the DDL is only for deriving and generating the Baz Go struct?
I acknowledge that it's not as convenient or robust as copy/pasting the same thing you run in the database, and sometimes it's extra work to determine the equivalent CREATE TABLE command from a complex view query.
Thanks!
Reacted by Soroush Javadi, Louis Brauer and Federico D'Eredità
Activity
ereyes01 commentedon Feb 27, 2020
I just found this package and it looks super useful. One of the first things I did was to search the issues to see if there was any insight on how views are handled, and found this.
Is the DDL code given ever actually run in the database? If it's only used to generate the structs, would a valid workaround be:
And then design your queries of
bazas normal, since the DDL is only for deriving and generating theBazGo struct?I acknowledge that it's not as convenient or robust as copy/pasting the same thing you run in the database, and sometimes it's extra work to determine the equivalent
CREATE TABLEcommand from a complex view query.Thanks!
kyleconroy commentedon Mar 1, 2020
@ereyes01 That's a good work around for the time being. The eventual goal is to fully support view creation and querying.
randomlogin commentedon Sep 3, 2020
Hi!
I'm using 1.5.0, am I right, that views are not supported there yet?
The only workaround is to construct appropriate table?
philipjscott commentedon Oct 4, 2020
Hi @kyleconroy! Really love sqlc; I'm wondering if there's any plans to tackle views any time soon? I'd willing to help out 😃