MilkStore 0.7.1

dotnet add package MilkStore --version 0.7.1
                    
NuGet\Install-Package MilkStore -Version 0.7.1
                    
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="MilkStore" Version="0.7.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MilkStore" Version="0.7.1" />
                    
Directory.Packages.props
<PackageReference Include="MilkStore" />
                    
Project file
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 MilkStore --version 0.7.1
                    
#r "nuget: MilkStore, 0.7.1"
                    
#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 MilkStore@0.7.1
                    
#: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=MilkStore&version=0.7.1
                    
Install as a Cake Addin
#tool nuget:?package=MilkStore&version=0.7.1
                    
Install as a Cake Tool

MilkStore

A micro-ORM for PostgreSQL, SQL Server and SQLite. Requires .NET 9 or later.

dotnet add package MilkStore
dotnet add package Microsoft.Data.Sqlite   # or Npgsql, or Microsoft.Data.SqlClient
SQLiteStore.Connect.File("app.db");                      // once, at startup
User.Ensure();                                           // create the table, add missing columns

public class User : SQLiteStoreObject<User>
{
    [Identity]    public int    UserID  { get; set; }     // or [Key] per column of a composite key
    [Concurrency] public int    Version { get; set; }     // optional; a stale write throws
    public               string Name    { get; set; }
    public               bool   Active  { get; set; }
}

var user = User.Insert(new { Name = "Alice", Active = true });
User.InsertMany(rows);                                   // one statement per batch, not one per row

User.FindById(user.UserID);                              // one row, or null
User.Where(u => u.Active && u.Name.StartsWith("A"));     // also All, First, take:/skip:, ...Async
user.Update(new { Name = "Alice Smith", Version = 2 });  // matched on the key + [Concurrency]
user.Delete();
User.Delete(u => !u.Active);                             // one statement

User.Transaction(() => { /* commits, or rolls back if it throws */ });
User.Query($"SELECT * FROM {User.Table} WHERE {Sql.Id("Name")} = {name}");   // values parameterised

SQLiteStore.AutoSchema = SchemaMode.Update;              // or: build every table on first use

A table is only ever created, or a missing column added, by Ensure(). Anything else that does not match its entity is reported on first use, with the SQL that would fix it, and left alone. Every member is documented in place — hover it, or see IMPLEMENTATION_PLAN.md for why it works the way it does.

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

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
0.7.1 120 9/2/2026
0.6.0 102 9/2/2026
0.4.0 97 9/2/2026
0.3.0 96 9/2/2026
0.2.0 98 9/2/2026
0.1.0 108 9/2/2026