DatabaseSharp.MySQL
1.0.2
dotnet add package DatabaseSharp.MySQL --version 1.0.2
NuGet\Install-Package DatabaseSharp.MySQL -Version 1.0.2
<PackageReference Include="DatabaseSharp.MySQL" Version="1.0.2" />
<PackageVersion Include="DatabaseSharp.MySQL" Version="1.0.2" />
<PackageReference Include="DatabaseSharp.MySQL" />
paket add DatabaseSharp.MySQL --version 1.0.2
#r "nuget: DatabaseSharp.MySQL, 1.0.2"
#:package DatabaseSharp.MySQL@1.0.2
#addin nuget:?package=DatabaseSharp.MySQL&version=1.0.2
#tool nuget:?package=DatabaseSharp.MySQL&version=1.0.2
<p align="center"> <img src="https://github.com/user-attachments/assets/4b024dea-dbd3-475c-9a7b-faf2869d5c8f" width="200" height="200" /> </p>
DatabaseSharp
This is a project to introduce simpler type conversion when communicating with a database.
The library here is designed to only communicate through STPs, since it is considered more secure than free SQL.
An example of how this works can be seen below:
var client = new SQLServerClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
var row = table[0];
int someValue = row.GetValue<int>("COL_NAME");
You can also deserialize directly into class objects like this:
public class SomeClass
{
[DatabaseSharp(ColumnName = "PK_NAME")]
public string Name { get; set; }
[DatabaseSharp(ColumnName = "ACT_VALUE")]
public int Value { get; set; }
}
var client = new SQLServerClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
var row = table[0];
SomeClass filled = row.Fill<SomeClass>();
These are just the methods on the row level. However you can also use these on the Table level, where it will instead make a list of the items, as such:
var client = new SQLServerClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
List<int> someValue = table.GetAllValues<int>("COL_NAME");
The project is available as a package on the NuGet Package Manager.
Connectors
There are different ADO.NET connectors for different SQL servers. Some of the adaptors does not have the same capabilities of others.
SQL Server
You can find it on the NuGet Package Manager.
PostgreSQL Server
You can find it on the NuGet Package Manager.
Use FUNCTIONS and not PROCEDURES with this connector!
PostgreSQL is very limited in its ADO.NET connector.
MySQL Server
You can find it on the NuGet Package Manager.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- DatabaseSharp (>= 1.7.2)
- MySqlConnector (>= 2.6.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.