Pawelharacz.Webjobs.Extensions.MSSqlDatabase 0.1.1

the extension of the Azure functions which add Bindings to SQL

Install-Package Pawelharacz.Webjobs.Extensions.MSSqlDatabase -Version 0.1.1
dotnet add package Pawelharacz.Webjobs.Extensions.MSSqlDatabase --version 0.1.1
<PackageReference Include="Pawelharacz.Webjobs.Extensions.MSSqlDatabase" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pawelharacz.Webjobs.Extensions.MSSqlDatabase --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Pawelharacz.Webjobs.Extensions.MSSqlDatabase, 0.1.1"
For F# scripts that support #r syntax, copy this into the source code to reference the package.

Sql Database Binding

The solution adds new sql bindings to azure function v2 and v3

Quick start

CLI:

dotnet add package Pawelharacz.Webjobs.Extensions.MSSqlDatabase

csproj:

<PackageReference Include="Pawelharacz.Webjobs.Extensions.MSSqlDatabase" Version="0.1.0" />

Binding

Currently solution supports only input bindnig.
The Project adds a MsSqlDb attribute

  • SqlQuery is required - it's a query which will be invoked
  • ConnectionStringSetting - name of application setting key. default key is "MsSqlDb"

Bining's mapping:

  • IEnumerable collection on our defined class
  • Single item of defined class
Examples
 [FunctionName("TestFunc")]
        public static  IActionResult Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get")]
            HttpRequest req, 
            [MsSqlDb(SqlQuery = "Select Id, Name from Examples", ConnectionStringSetting = "MsSqlConnectionString")] IEnumerable<Example> examples) 
[FunctionName("TestFunc")]
        public static async Task<IActionResult> RunFilterOneAsync(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "TestFunc/one/{id}")]
            HttpRequest req, 
            [MsSqlDb(SqlQuery = "Select Id, Name from Examples where id = {id}")] Example example)

Full examples are available here

Known issues

  1. Azure function v3 requires functions v2 compatibility mode. it can be turned on using this app setting:
    "FUNCTIONS_V2_COMPATIBILITY_MODE": "true"

Sql Database Binding

The solution adds new sql bindings to azure function v2 and v3

Quick start

CLI:

dotnet add package Pawelharacz.Webjobs.Extensions.MSSqlDatabase

csproj:

<PackageReference Include="Pawelharacz.Webjobs.Extensions.MSSqlDatabase" Version="0.1.0" />

Binding

Currently solution supports only input bindnig.
The Project adds a MsSqlDb attribute

  • SqlQuery is required - it's a query which will be invoked
  • ConnectionStringSetting - name of application setting key. default key is "MsSqlDb"

Bining's mapping:

  • IEnumerable collection on our defined class
  • Single item of defined class
Examples
 [FunctionName("TestFunc")]
        public static  IActionResult Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get")]
            HttpRequest req, 
            [MsSqlDb(SqlQuery = "Select Id, Name from Examples", ConnectionStringSetting = "MsSqlConnectionString")] IEnumerable<Example> examples) 
[FunctionName("TestFunc")]
        public static async Task<IActionResult> RunFilterOneAsync(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = "TestFunc/one/{id}")]
            HttpRequest req, 
            [MsSqlDb(SqlQuery = "Select Id, Name from Examples where id = {id}")] Example example)

Full examples are available here

Known issues

  1. Azure function v3 requires functions v2 compatibility mode. it can be turned on using this app setting:
    "FUNCTIONS_V2_COMPATIBILITY_MODE": "true"

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.1 183 1/12/2020
0.1.1-pullrequest0006-0004 159 1/12/2020
0.1.0 334 1/5/2020