File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -986,7 +986,29 @@ The stored procedure `dbo.DeleteToDo` must be created on the database. In this
986
986
987
987
# [ v2] ( #tab/python-v2 )
988
988
989
- No equivalent sample for v2 at this time.
989
+ ``` python
990
+ import logging
991
+ import azure.functions as func
992
+ from azure.functions.decorators.core import DataType
993
+
994
+ app = func.FunctionApp()
995
+
996
+ @app.function_name (name = " DeleteToDo" )
997
+ @app.route (route = " deletetodo/{id} " )
998
+ @app.sql_input (arg_name = " products" ,
999
+ command_text = " DeleteToDo" ,
1000
+ command_type = " StoredProcedure" ,
1001
+ parameters = " @Id={id} " ,
1002
+ connection_string_setting = " SqlConnectionString" )
1003
+ def get_todo (req : func.HttpRequest, todo : func.SqlRowList) -> func.HttpResponse:
1004
+ rows = list (map (lambda r : json.loads(r.to_json()), todo))
1005
+
1006
+ return func.HttpResponse(
1007
+ json.dumps(rows),
1008
+ status_code = 200 ,
1009
+ mimetype = " application/json"
1010
+ )
1011
+ ```
990
1012
991
1013
# [ v1] ( #tab/python-v1 )
992
1014
You can’t perform that action at this time.
0 commit comments