in azure/functions/decorators/function_app.py [0:0]
def mysql_input(self,
arg_name: str,
command_text: str,
connection_string_setting: str,
command_type: Optional[str] = 'Text',
parameters: Optional[str] = None,
data_type: Optional[DataType] = None,
**kwargs) -> Callable[..., Any]:
"""The mysql_input decorator adds
:class:`MySqlInput` to the :class:`FunctionBuilder` object
for building :class:`Function` object used in worker function
indexing model. This decorator will work only with extension bundle 4.x
and above.
This is equivalent to defining MySqlInput in the function.json which
enables the function to read from a MySql database.
All optional fields will be given default value by function host when
they are parsed by function host.
Ref: https://aka.ms/mysqlbindings
:param arg_name: The name of the variable that represents a
:class:`MySqlRowList` input object in function code
:param command_text: The Transact-SQL query command or name of the
stored procedure executed by the binding
:param connection_string_setting: The name of an app setting that
contains the connection string for the database against which the
query or stored procedure is being executed
:param command_type: A CommandType value, which is Text for a query
and StoredProcedure for a stored procedure
:param parameters: Zero or more parameter values passed to the
command during execution as a single string. Must follow the format
@param1=param1,@param2=param2
:param data_type: Defines how Functions runtime should treat the
parameter value
:param kwargs: Keyword arguments for specifying additional binding
fields to include in the binding json
:return: Decorator function.
"""
@self._configure_function_builder
def wrap(fb):
def decorator():
fb.add_binding(
binding=MySqlInput(
name=arg_name,
command_text=command_text,
connection_string_setting=connection_string_setting,
command_type=command_type,
parameters=parameters,
data_type=parse_singular_param_to_enum(data_type,
DataType),
**kwargs))
return fb
return decorator()
return wrap