Skip to content

Stored Procedure Support #900

@yorek

Description

@yorek

Summary

Allow stored procedure defined in the database to be exposed as REST or GraphQL

Motivation

Stored procedures are widely used, simplify data access, provide abstraction over base tables, and may encapsulate even complex 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

CRUD Support

Stored Procedure will support any CRUD action in the sense that it will be responsibility of the developer - or whoever is defining the configuration file - to properly configure the allowed actions to make sure the related exposed entity will allow actions that are compatible with the stored procedure. In fact, a stored procedure can potentially do any operation on data, and DAB will have no way to know what operation is being done, but it will only be able to see the returned result set.

Relationship Support

At this time, entities backed by a stored procedure will not be able to be used in relationships with other entities nor establish relationships with other entities.

Stored Procedure requirements

A stored procedure may not return any result set.
A stored procedure may return more than one result set, but all result sets except the first will be ignored by DAB.

Stored Procedure Parameters

Only scalar parameters are supported in DAB. In GraphQL each parameter will be exposed as a query or mutation parameter. For REST each parameter will be exposed as a query string parameter.

Prior Work

Stored Procedure Support has been originally discussed in the following issues: #624, #757, #869

Metadata

Metadata

Labels

rfcRequest for comment

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions