Skip to content

Commit

Permalink
Minor Release 3.7.* (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishael-o authored May 19, 2024
2 parents 94a8774 + 7740ee1 commit 0030c86
Show file tree
Hide file tree
Showing 25 changed files with 174 additions and 99 deletions.
47 changes: 40 additions & 7 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ on:
default: false
required: false
type: boolean
create_sync_pr:
description: "Create sync pull request?"
default: false
required: false
type: boolean

env:
configuration: release
Expand All @@ -45,10 +50,6 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Setup .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
- name: Setup .NET 6
uses: actions/setup-dotnet@v4
with:
Expand All @@ -64,7 +65,7 @@ jobs:
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
- name: Merge coverage reports
run: dotnet-coverage merge ${{ env.coverageReportPath }}*.xml --recursive -f cobertura -o ${{ env.coverageReportPath }}${{ env.mergedCoverageReportFileName }}
run: dotnet-coverage merge ${{ env.coverageReportPath }}**/*.xml -f cobertura -o ${{ env.coverageReportPath }}${{ env.mergedCoverageReportFileName }}
- name: Codecov
uses: codecov/codecov-action@v4
with:
Expand Down Expand Up @@ -133,7 +134,7 @@ jobs:
run:
working-directory: docs/github-pages
env:
docfx_version: 2.75.2
docfx_version: 2.76.0

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
Expand All @@ -155,7 +156,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
Expand All @@ -181,3 +182,35 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

create-sync-pr:
if: ${{ github.ref_name == 'main' && inputs.create_sync_pr == true }}
name: Create Sync PR
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
- name: Create Sync PR
run: |
set +e
PR_EXISTS=$(gh pr list --base develop --head main --state open --json number --jq '.[0]')
echo "Existing PR number: $PR_EXISTS"
if [ -z "$PR_EXISTS" ];
then
PR_URL=$(gh pr create --base develop --head main --title "main to develop sync" --body "This is an automated PR to sync main into develop" --label "ignore-for-release" 2>&1)
CREATE_EXIT_CODE=$?
echo "Response: $PR_URL - Exit Code: $CREATE_EXIT_CODE"
if [[ $CREATE_EXIT_CODE -eq 0 ]];
then
echo "Created PR: $PR_URL"
gh pr merge --auto --merge "$PR_URL"
fi
exit 0;
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Mishael Ogochukwu
Copyright © 2023 Mishael Ogochukwu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ A simple SQL builder for [Dapper](https://github.com/DapperLib/Dapper) using [st

Refer to the [Quick Start](https://mishael-o.github.io/Dapper.SimpleSqlBuilder/) guide for more details.

## Share Your Feedback

If you like the library, use it, share it, and give it a ⭐️. For any suggestions, feature requests, or issues feel free to create an [issue](https://github.com/mishael-o/Dapper.SimpleSqlBuilder/issues) to help improve the library.

## Contributing

Refer to the [Contributing](https://github.com/mishael-o/Dapper.SimpleSqlBuilder/blob/main/docs/CONTRIBUTING.md) guide for more details.
Expand Down
2 changes: 1 addition & 1 deletion docs/github-pages/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"globalMetadata": {
"_appName": "Dapper.SimpleSqlBuilder",
"_appTitle": "Dapper.SimpleSqlBuilder",
"_appFooter": "🏗️ Made with <a href=\"https://dotnet.github.io/docfx\">Docfx</a>.</span>",
"_appFooter": "Copyright © 2024 Mishael Ogochukwu. 🏗️ with <a href=\"https://dotnet.github.io/docfx\">Docfx</a>.",
"_appLogoPath": "images/logo.svg",
"_appFaviconPath": "images/favicon.ico",
"_enableSearch": true,
Expand Down
2 changes: 1 addition & 1 deletion docs/github-pages/docs/builders/dapper-comparison.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Comparison to Dapper

The code snippets below show how the library compares to Dapper and Dapper's SqlBuilder when writing SQL queries.
The code snippets below show how the library compares to Dapper and Dapper's SqlBuilder when writing SQL queries. For performance comparisons, see the [Performance](../miscellaneous/performance.md) section.

The code is extracting data from a `Users` table where the `UserTypeId` is equal to a given `userTypeId` and the `Role` is equal to a given `role`.

Expand Down
4 changes: 4 additions & 0 deletions docs/github-pages/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ The library provides multiple packages to suit your needs.

The library supports any database that Dapper supports. However, the library has been [tested](https://github.com/mishael-o/Dapper.SimpleSqlBuilder/tree/main/src/Tests/IntegrationTests/SimpleSqlBuilder.IntegrationTests) against the latest versions of MSSQL, MySQL and PostgreSQL databases.

## Share Your Feedback

If you like the library, use it, share it, and give it a ⭐️ on GitHub. For any suggestions, feature requests, or issues feel free to create an [issue](https://github.com/mishael-o/Dapper.SimpleSqlBuilder/issues) on GitHub to help improve the library.

## Next Steps

- [Quick Start](../index.md)
Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/SimpleSqlBuilder.BenchMark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The benchmark project is mainly to help with development and code optimisations.

The benchmark below shows the performance of the `Builder` and `Fluent Builder` compared to Dapper's [SqlBuilder](https://github.com/DapperLib/Dapper/tree/main/Dapper.SqlBuilder) for building queries only (**this does not benchmark SQL execution**).
The benchmark was done with the [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet). The benchmark results may vary depending on the system configuration, OS, and other factors but the result below gives a general indication of performance.
The benchmark was done with the [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) library. The benchmark results may vary depending on the system configuration, OS, and other factors but the result below gives a general indication of performance.

To run the benchmark you will need to ensure you have the **corresponding SDKs for the frameworks** installed, then you can execute the command below in the benchmark project directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net461;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.78" />
<PackageReference Include="AutoFixture" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Dapper.SqlBuilder" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/Builder/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup Label="PackagePropertyGroup">
<Version>1.0.0</Version>
<Authors>Mishael Ogochukwu</Authors>
<Copyright>Copyright (c) 2023 Mishael Ogochukwu</Copyright>
<Copyright>Copyright © 2023 Mishael Ogochukwu</Copyright>
<Company>Mishael Ogochukwu</Company>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>$(AssemblyName)</PackageId>
Expand All @@ -14,7 +14,7 @@
<PackageProjectUrl>https://mishael-o.github.io/Dapper.SimpleSqlBuilder/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>package-icon.png</PackageIcon>
<PackageTags>dapper;sql;sql-builder;dapper-sql-builder;simple-sql-builder;dapper-simple-sql-builder</PackageTags>
<PackageTags>dapper;sql;sql-builder;sql-query;sql-query-builder;dapper-sql-builder;simple-sql-builder;dapper-simple-sql-builder</PackageTags>
<RepositoryUrl>https://github.com/mishael-o/Dapper.SimpleSqlBuilder</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -28,8 +28,8 @@
</PropertyGroup>

<ItemGroup Label="PackageItemGroup">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="All" />
</ItemGroup>

<Target Name="OverrideVersion" AfterTargets="GetBuildVersion" Condition="'$(PublicRelease)' == 'False'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class ServiceCollectionExtensions
/// <param name="service">The <see cref="IServiceCollection"/> to add services to.</param>
/// <param name="serviceLifetime">The <see cref="ServiceLifetime"/> for the <see cref="ISimpleBuilder"/>.</param>
/// <returns>The <see cref="IServiceCollection"/> instance.</returns>
/// <exception cref="ArgumentNullException">Throws a <see cref="ArgumentNullException"/> when <paramref name="service"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException">Throws an <see cref="ArgumentNullException"/> when <paramref name="service"/> is <see langword="null"/>.</exception>
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
{
return service
Expand All @@ -28,7 +28,7 @@ public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection ser
/// <param name="configure">The action to configure the <see cref="SimpleBuilderOptions"/>.</param>
/// <param name="serviceLifetime">The <see cref="ServiceLifetime"/> for the <see cref="ISimpleBuilder"/>.</param>
/// <returns>The <see cref="IServiceCollection"/> instance.</returns>
/// <exception cref="ArgumentNullException">Throws a <see cref="ArgumentNullException"/> when <paramref name="service"/> or <paramref name="configure"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentNullException">Throws an <see cref="ArgumentNullException"/> when <paramref name="service"/> or <paramref name="configure"/> is <see langword="null"/>.</exception>
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, Action<SimpleBuilderOptions> configure, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
{
if (service is null)
Expand Down Expand Up @@ -57,7 +57,7 @@ public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection ser
/// <param name="serviceLifetime">The <see cref="ServiceLifetime"/> for the <see cref="ISimpleBuilder"/>.</param>
/// <returns>The <see cref="IServiceCollection"/> instance.</returns>
/// <exception cref="ArgumentNullException">
/// Throws a <see cref="ArgumentNullException"/> when <paramref name="service"/> or <paramref name="configurationSectionPath"/> is <see langword="null"/>, empty or white-space.
/// Throws an <see cref="ArgumentNullException"/> when <paramref name="service"/> is <see langword="null"/> or when <paramref name="configurationSectionPath"/> is <see langword="null"/>, empty or white-space.
/// </exception>
public static IServiceCollection AddSimpleSqlBuilder(this IServiceCollection service, string configurationSectionPath, ServiceLifetime serviceLifetime = ServiceLifetime.Singleton)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net6.0;net8.0</TargetFrameworks>
<RootNamespace>Dapper.SimpleSqlBuilder.DependencyInjection</RootNamespace>
<AssemblyName>Dapper.SimpleSqlBuilder.DependencyInjection</AssemblyName>
<Description>Dependency injection extension for Dapper.SimpleSqlBuilder.</Description>
<Title>Dapper SimpleSqlBuilder Dependency Injection</Title>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>A simple SQL builder for Dapper using string interpolation and fluent API for building safe static and dynamic SQL queries.</Description>
<RootNamespace>Dapper.SimpleSqlBuilder.StrongName</RootNamespace>
<AssemblyName>Dapper.SimpleSqlBuilder.StrongName</AssemblyName>
Expand All @@ -15,12 +15,9 @@
<Using Remove="System.Net.Http"></Using>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper.StrongName" Version="2.1.28" />
<PackageReference Include="Dapper.StrongName" />
<PackageReference Include="Microsoft.Bcl.HashCode" Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'netstandard2.0'"/>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Builder/SimpleSqlBuilder/Core/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public abstract class Builder : ISqlBuilder
/// </summary>
/// <typeparam name="T">The type to cast the value to.</typeparam>
/// <param name="parameterName">The name of the parameter.</param>
/// <returns>The value of the parameter. Note <see cref="DBNull.Value"/> is not returned, instead the value is returned as <see langword="null"/>.</returns>
/// <returns>The value of the parameter. Note <see cref="DBNull.Value">DBNull.Value</see> is not returned, instead the value is returned as <see langword="null"/>.</returns>
public abstract T GetValue<T>(string parameterName);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public interface IFluentSqlBuilder : ISqlBuilder, IFluentBuilder
/// </summary>
/// <typeparam name="T">The type to cast the value to.</typeparam>
/// <param name="parameterName">The name of the parameter.</param>
/// <returns>The value of the parameter. Note <see cref="DBNull.Value"/> is not returned, instead the value is returned as <see langword="null"/>.</returns>
/// <returns>The value of the parameter. Note <see cref="DBNull.Value">DBNull.Value</see> is not returned, instead the value is returned as <see langword="null"/>.</returns>
T GetValue<T>(string parameterName);
}
9 changes: 3 additions & 6 deletions src/Builder/SimpleSqlBuilder/SimpleSqlBuilder.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>A simple SQL builder for Dapper using string interpolation and fluent API for building safe static and dynamic SQL queries.</Description>
<RootNamespace>Dapper.SimpleSqlBuilder</RootNamespace>
<AssemblyName>Dapper.SimpleSqlBuilder</AssemblyName>
Expand All @@ -12,12 +12,9 @@
<Using Remove="System.Net.Http"></Using>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="Dapper" />
<PackageReference Include="Microsoft.Bcl.HashCode" Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'netstandard2.0'"/>
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/Dapper.SimpleSqlBuilder.sln
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3882C05C-BF9
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
version.json = version.json
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "images", "images", "{72D162B8-2003-41DF-9F04-483FDF95E7C2}"
Expand Down
4 changes: 0 additions & 4 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
</PropertyGroup>

<ItemGroup Label="GlobalItemGroup">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<AssemblyAttribute Include="System.CLSCompliantAttribute">
<_Parameter1>false</_Parameter1>
</AssemblyAttribute>
Expand Down
Loading

0 comments on commit 0030c86

Please sign in to comment.