2 ms·
The pitch on the project page for Schema Driven APIs[0] mentions "hide implementation details with views of your data" (as in CREATE VIEW) and "automatic relati
by infogulch 10y ago
The pitch on the project page for Schema Driven APIs[0] mentions "hide implementation details with views of your data" (as in CREATE VIEW) and "automatic relations with the REFERENCES constraint". Do both of these work together? E.g. could I create an "api" schema that consists entirely of views that query other schema(s), but still have the relations automatically determined?
https://github.com/calebmer/postgraphql#schema-driven-apis https://github.com/calebmer/postgraphql#schema-driven-apis
- ruslan_talpa 10y agoYes you can. That is EXACTLY how you are supposed to do it (PostgREST and PostGraphQL). Do not expose your tables, expose a schema containing only views and functions. There are small bugs related to relation detection between views but 95% of the times it works and everything can be fixed and also there are workarounds for those bugs.