From c6ad1e44e803202808d31360426d777bd8da6d3a Mon Sep 17 00:00:00 2001 From: Karthikeyan C Date: Mon, 16 Sep 2024 13:39:47 +0530 Subject: [PATCH] document the new CLI command --- docs/usage/stored_procedures.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/usage/stored_procedures.md b/docs/usage/stored_procedures.md index dc1e9ffa..bcf58de9 100644 --- a/docs/usage/stored_procedures.md +++ b/docs/usage/stored_procedures.md @@ -14,9 +14,23 @@ In this guide, we'll look at how to use stored procedures with the ndc-sqlserver ## Tracking Stored Procedures -The ndc-sqlserver connector can track stored procedures in a SQL Server database. The stored -procedures present in the database are automatically added while introspecting the database -via the `update` operation. The stored procedures will appear in the `$.metadata.storedProcedures` +The ndc-sqlserver connector can track stored procedures in a SQL Server database. + +The stored procedures present in the database can be added by running the following command: + +``` +ddn connector plugin --connector app/sqlserver/connector.yaml -- stored-procedures +``` + +If you want to overwrite the existing stored procedures, + +``` +ddn connector plugin --connector app/sqlserver/connector.yaml -- stored-procedures --overwrite +``` + + + +After running the above command, the stored procedures will appear in the `$.metadata.storedProcedures` key of the configuration that is generated by the `update` operation. @@ -99,6 +113,12 @@ we can add a return type for it, as following: } ``` +### Marking required arguments as `nonNullable` + +If your stored procedure contains a required argument, then you can mark the argument as `nonNullable` +which will enable to throw a validation error as soon as possible. For example, in the above, the `Phone` field +is a required argument, hence it is marked as `nonNullable`. + ## Schema of Stored Procedures ## Schema