Open JerryNixon opened 2 months ago
I would love to have this. My primary use case currently, is requesting paginated data from a SP for a datagrid, but also wanting to know the total count (also, given filter and sort data).
Am currently achieving this with 2 SP's, and 2 queries - but being able to set an output param with the total count for the given filter would be much more preferable.
Should this be REST only? @michaelstaib GraphQL have output params on the roadmap?
Good to have a list of validations that needs to be performed with the above CLI commands.
Note: Individual value returned by the output parameter will always be scalar, so there's no need for us to have an array of value inside output params. No database supports a table type return value in output parameters today.
@JerryNixon, Can you add some more details on each of these values :
"parameters": [ // current hierarchy position
{
...
"kind": "input | output | input-output | error-provider", (optional default: input)
}
What is it?
Output scenario
This demonstrates an output parameter.
Current Configuration
Current configuration supports parameters and their default values - only.
Future Configuration
New object type provides more flexibility. This is an additive/alternative change.
Description
Metadata
Description
is used to enhance both theOpenAPI
andGraphQL Schema
.CLI impact
Though this may change to align with ongoing work, this is pretty close.
dab update <entity-name> --metadata.description "value"
dab update <entity-name> --parameters "<parameter-name>" --name "value"
dab update <entity-name> --parameters "<parameter-name>" --alias "value"
dab update <entity-name> --parameters "<parameter-name>" --description "value"
dab update <entity-name> --parameters "<parameter-name>" --data-type "value"
dab update <entity-name> --parameters "<parameter-name>" --required "value"
dab update <entity-name> --parameters "<parameter-name>" --default "value"
dab update <entity-name> --parameters "<parameter-name>" --kind "value"
How do we delete a parameter from the CLI?
dab update <entity-name> --parameters "<parameter-name>" --delete
Output parameter
This supports both SELECT and OUTPUT params at the same time.
Example (page count)
Output payload (GraphQL)
TBD
Output payload (REST)
Database parity
Error-Provider
Today, stored procedures cannot raise an error in a controlled way.
Today's error format (REST)
Today's error format (GQL)
Future error format (REST)
The original
error
remains - it will return theFirst()
from the newerrors
array.Future error format (GQL)
No change.
Raising errors versus returning errors
This section shows how returning errors is better than raising them. Reasons:
Raising errors
(versus) Returning errors
Effectively, an
error-provider
is an output parameter with a JSON payload of errors.Error result
Questions
status
in an error impact the returned HTTP status? Return 200 (REST & GQL)Related Issues to Close
1841
1826
1843
2346
2222
1748
1844