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.
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.
// Install UskokDB.MySql as a Cake Addin
#addin nuget:?package=UskokDB.MySql&version=1.1.0
// Install UskokDB.MySql as a Cake Tool
#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. |
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 | 85 | 5/26/2024 |
2.4.4 | 82 | 5/25/2024 |
2.4.3 | 76 | 5/25/2024 |
2.4.2 | 73 | 5/25/2024 |
2.4.1 | 87 | 5/24/2024 |
2.4.0 | 86 | 5/24/2024 |
2.3.2 | 91 | 2/29/2024 |
2.3.1 | 85 | 2/28/2024 |
2.3.0 | 92 | 2/28/2024 |
2.2.0 | 139 | 8/16/2023 |
2.1.1 | 114 | 8/31/2023 |
2.1.0 | 124 | 8/7/2023 |
2.0.2 | 135 | 7/28/2023 |
2.0.1 | 128 | 7/28/2023 |
2.0.0 | 131 | 7/28/2023 |
1.9.0 | 135 | 7/19/2023 |
1.8.0 | 151 | 7/19/2023 |
1.7.0 | 191 | 4/21/2023 |
1.6.0 | 147 | 4/21/2023 |
1.5.0 | 163 | 4/21/2023 |
1.4.0 | 149 | 4/20/2023 |
1.3.0 | 165 | 4/12/2023 |
1.2.0 | 162 | 4/12/2023 |
1.1.0 | 149 | 4/10/2023 |
1.0.0 | 176 | 4/9/2023 |
Added documentation