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" />
paket add Pawelharacz.Webjobs.Extensions.MSSqlDatabase --version 0.1.1
#r "nuget: Pawelharacz.Webjobs.Extensions.MSSqlDatabase, 0.1.1"
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
- 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
- Azure function v3 requires functions v2 compatibility mode. it can be turned on using this app setting:
"FUNCTIONS_V2_COMPATIBILITY_MODE": "true"
Dependencies
-
.NETCoreApp 2.0
- FastMember (>= 1.5.0)
- Microsoft.Azure.WebJobs (>= 3.0.14)
- Microsoft.Azure.WebJobs.Host.Storage (>= 3.0.14)
- Microsoft.CSharp (>= 4.5.0)
- System.Data.SqlClient (>= 4.6.1)
-
.NETCoreApp 3.1
- FastMember (>= 1.5.0)
- Microsoft.Azure.WebJobs (>= 3.0.14)
- Microsoft.Azure.WebJobs.Host.Storage (>= 3.0.14)
- Microsoft.CSharp (>= 4.7.0)
- System.Data.SqlClient (>= 4.8.0)
-
.NETStandard 2.1
- FastMember (>= 1.5.0)
- Microsoft.Azure.WebJobs (>= 3.0.14)
- Microsoft.Azure.WebJobs.Host.Storage (>= 3.0.14)
- Microsoft.CSharp (>= 4.5.0)
- System.Data.SqlClient (>= 4.6.1)
Used By
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 |