LothiumDB 1.2.0
dotnet add package LothiumDB --version 1.2.0
NuGet\Install-Package LothiumDB -Version 1.2.0
<PackageReference Include="LothiumDB" Version="1.2.0" />
paket add LothiumDB --version 1.2.0
#r "nuget: LothiumDB, 1.2.0"
// Install LothiumDB as a Cake Addin #addin nuget:?package=LothiumDB&version=1.2.0 // Install LothiumDB as a Cake Tool #tool nuget:?package=LothiumDB&version=1.2.0
LothiumDB
LothiumDB is a simple micro ORM for .Net applications written entirely in C# for fun and offer a lot of different methods to find data in and out of a database. The library has a very simple syntax and give flexibility to the final user if he want to use a query written inside a string variable, or using the SqlBuilder class.
db.query<PocoType>("SELECT * FROM TABLE");
var obj = new PocoObject()
{
Prop1 = "Prop1",
Prop2 = "Prop2";
};
db.Insert<PocoType>(obj);
LothiumDB offers the ability to work with Poco Object to make operations inside the database. The library work well when a Poco Object have inside it all the needed attribute, in fact all the information about the associated table and column will be extracted automatically.
using LothiumDB.Attributes;
namespace TestModels
{
[Serializable]
[TableName("TableName")]
[PrimaryKey("Prop1")]
public class TabellaDiTest
{
[ColumnName("Prop1")] public string? Property1 { get; set; }
[ColumnName("Prop2")] public string? Property2 { get; set; }
}
}
Getting started
You can install LothiumDB directly from NuGet using the NuGet Manager inside Visual Studio or with this command:
dotnet add package LothiumDB
The simplest way to set up LothiumDB is using the Database
class and the SqlBuilder
query constructor.
using LothiumDB;
public class Program
{
// Instance the configuration object
var config = new DatabaseConfiguration();
// Set the provider settings
config.Provider
.AddProvider(providerName: "MSSqlServer")
.AddConnectionString(connectionString);
// Set the audit settings
config.Audit
.AddAudit()
.SetUser(auditUser: "DatabaseAdmin");
// Create the new db instance
var db = config.BuildDatabase();
// Execute the first query
var sql = new SqlBuilder().Select("*").From("TableName");
List<PocoObject> list = db.FetchAll<PocoObject>(sql);
// Execute the second query
var sql2 = new SqlBuilder().SelectTop(1, "*").From("TableName");
PocoObject pocoObj = db.FetchSingle<PocoObject>(sql);
}
Bug Reports
If you want to contribute to this project, you can send a pull request to the GitHub Repository and i'll be happy to add it to the project. In The feature i'll separate the Master Branch from the Develop Branch
I welcome any type of bug reports and suggestions through my GitHub Issue Tracker.
LothiumDB is copyright © 2023 - Provided under the GNU General Public License v3.0.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. |
-
net6.0
- Microsoft.Data.SqlClient (>= 5.2.0-preview3.23201.1)
- MySql.Data (>= 8.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.
Major fix to methods execution.
Redesing completely the logic of the auto query generations.
Added a new Configuration object for the database creation.