UskokDB.MySql
1.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package UskokDB.MySql --version 1.1.0
NuGet\Install-Package UskokDB.MySql -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UskokDB.MySql" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UskokDB.MySql" Version="1.1.0" />
<PackageReference Include="UskokDB.MySql" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add UskokDB.MySql --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: UskokDB.MySql, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package UskokDB.MySql@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=UskokDB.MySql&version=1.1.0
#tool nuget:?package=UskokDB.MySql&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
UskokDB
And extension library for UskokDB
used for runtime table creating and inserting/replacing to the table some examples:
Example 1
class Person
{
public string Name {get;set;}
public string LastName {get;set;}
}
MySqlTable<Person> table = new MySqlTable<Person>("tablename");
table.CreateIfNotExist();
await table.CreateIfNotExistAsync();
The resulting mysql string is
Create Table IF NOT EXISTS `tablename` (Name Text, LastName Text)
Example
class Person
{
[PrimaryKey]
public Guid Id;
[MaxLength(20)]
public string Name {get;set;}
//Unless the length is specified the
public string LastName {get;set;}
[AutoIncrement]//not how ages works but...
public int Age {get;set;}
[NotMapped]
public string FullName => $"{Name} {LastName}";
}
MySqlTable<Person> table = new MySqlTable<Person>("tablename");
// Creation string shown in the example
table.CreateIfNotExist();
await table.CreateIfNotExistAsync();
//
Person person1 = new Person {
Id = Guid.NewGuid(),
Name = "Vuk",
LastName = "Uskokovic",
Age = 0
};
Person person2 = new Person {
Id = Guid.NewGuid(),
Name = "Vuk",
LastName = "Uskokovic",
Age = 0
};
table.Insert(person1);
await table.InsertAsync(person2);
person1.Age = 21;//Lets say I aged 21 years
person2.Age = 22;
await table.ReplaceAsync(person1);
table.Replace(person2);
The resulting mysql for the table is
Create Table IF NOT EXISTS `tablename` (Id VARHCAR(36) PRIMARY KEY, Name VARCHAR(20), LastName TEXT, Age INT AUTO_INCREMENT)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- UskokDB (>= 1.1.0)
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 | |
---|---|---|---|
2.4.5 | 207 | 5/26/2024 | |
2.4.4 | 153 | 5/25/2024 | |
2.4.3 | 143 | 5/25/2024 | |
2.4.2 | 138 | 5/25/2024 | |
2.4.1 | 150 | 5/24/2024 | |
2.4.0 | 157 | 5/24/2024 | |
2.3.2 | 153 | 2/29/2024 | |
2.3.1 | 148 | 2/28/2024 | |
2.3.0 | 151 | 2/28/2024 | |
2.2.0 | 209 | 8/16/2023 | |
2.1.1 | 181 | 8/31/2023 | |
2.1.0 | 199 | 8/7/2023 | |
2.0.2 | 211 | 7/28/2023 | |
2.0.1 | 205 | 7/28/2023 | |
2.0.0 | 205 | 7/28/2023 | |
1.9.0 | 206 | 7/19/2023 | |
1.8.0 | 223 | 7/19/2023 | |
1.7.0 | 277 | 4/21/2023 | |
1.6.0 | 230 | 4/21/2023 | |
1.5.0 | 246 | 4/21/2023 | |
1.4.0 | 234 | 4/20/2023 | |
1.3.0 | 248 | 4/12/2023 | |
1.2.0 | 252 | 4/12/2023 | |
1.1.0 | 231 | 4/10/2023 | |
1.0.0 | 266 | 4/9/2023 |
Added documentation