-
Notifications
You must be signed in to change notification settings - Fork 288
Description
Summary
Allow views defined in the database to be exposed as REST or GraphQL
Motivation
Views are widely used, simplify data access, provide abstraction over base tables, and may encapsulate basic business logic definition. They can also be used as an additional security mechanism to reduce exposed surface area. All these points help to make solutions simpler and in general helps DAB to support existing databases and scenarios.
Functional Specifications
Support for view must be equivalent to the same support provided to base tables. In case a primary key cannot be automatically identified for a view, the developer will be able to specify it manually, as proposed here already: #780
CRUD Support
Views will support any CRUD action. "Read" support is straightforward. Read, Update and Delete support will be provided just like as if DAB is dealing with a table. It will be responsibility of the developer - or whoever is defining the configuration file - to properly configure the allowed actions to make sure the exposed entity will allow actions that are compatible with the view. For example, if a view is not updatable, it's up to the person defining the DAC config file to prevent actions like Create, Update and Delete on the DAB entity related to the view.
Relationship Support
View will support DAB relationship just like a regular table does
Prior Work
View support has been originally discussed in the following issues: #357, #378, #780