Pawelharacz.Webjobs.Extensions.MSSqlDatabase 0.1.1

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"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pawelharacz.Webjobs.Extensions.MSSqlDatabase as a Cake Addin
#addin nuget:?package=Pawelharacz.Webjobs.Extensions.MSSqlDatabase&version=0.1.1

// Install Pawelharacz.Webjobs.Extensions.MSSqlDatabase as a Cake Tool
#tool nuget:?package=Pawelharacz.Webjobs.Extensions.MSSqlDatabase&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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 Downloads Last updated
0.1.1 240 1/12/2020
0.1.1-pullrequest0006-0004 210 1/12/2020
0.1.0 400 1/5/2020