Skip to content

Commit

Permalink
Added readme file and updated props to include in build.
Browse files Browse the repository at this point in the history
  • Loading branch information
sextondjc committed Jan 19, 2025
1 parent 9fcac3d commit 1d06c7a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Include="..\..\readme.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<!--<ItemGroup>
-->
<!-- Add common package references -->
<!--
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>-->
</Project>
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Syrx.MySql

This project provides Syrx support for MySql. The overall experience of using [Syrx](https://github.com/Syrx/Syrx) remains the same. The only difference should be during dependency registration.


## Installation
> [!TIP]
> We recommend installing the Extensions package which includes extension methods for easier configuration.
|Source|Command|
|--|--|
|.NET CLI|```dotnet add package Syrx.MySql.Extensions```
|Package Manager|```Install-Package Syrx.MySql.Extensions```
|Package Reference|```<PackageReference Include="Syrx.MySql.Extensions" Version="2.4.0" />```|
|Paket CLI|```paket add Syrx.MySql.Extensions --version 2.4.0```|

However, if you don't need the configuration options, you can install the standalone Oracle package.

Standalone installation of the package is via [nuget](https://www.nuget.org/packages/Syrx.MySql/). However we recommend installing the extensions package.

|Source|Command|
|--|--|
|.NET CLI|```dotnet add package Syrx.MySql```
|Package Manager|```Install-Package Syrx.MySql```
|Package Reference|```<PackageReference Include="Syrx.MySql" Version="2.4.0" />```|
|Paket CLI|```paket add Syrx.MySql --version 2.4.0```|


## Extensions
The `Syrx.MySql.Extensions` package provides dependency injection support via extension methods.

```csharp
// add a using statement to the top of the file or in a global usings file.
using Syrx.Commanders.Databases.Connectors.MySql.Extensions;

public static IServiceCollection Install(this IServiceCollection services)
{
return services
.UseSyrx(factory => factory // inject Syrx
.UseMySql(builder => builder // using the MySql implementation
.AddConnectionString(/*...*/) // add/resolve connection string details
.AddCommand(/*...*/) // add/resolve commands for each type/method
)
);
}
```

## Credits
Syrx is inspired by and build on top of [Dapper](https://github.com/DapperLib/Dapper).
MySql support is provided by [MySqlConnector](https://github.com/mysql-net/MySqlConnector).

0 comments on commit 1d06c7a

Please sign in to comment.