SoloTable.Core 0.1.0-preview.3

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

SoloTable

Single-table schema sync and additive scaffold for .NET 8 / .NET 9.

What this is: create or alter one table at a time (code-first), and scaffold C# / EF models without wiping other tables or other generated files (additive DB-first).

What this is not: a full ORM, EF migrations replacement, or a tool that rewrites your entire database model on every run.

Install one provider package, connect with its facade, then either:

Approach Direction Scope
Code-first C# → database One table per SyncAsync / EnsureAsync
DB-first Database → C# One table, named tables, or schema — additive file writes / DbContext merge

Current release: 0.1.0-preview — evaluation / early adoption. APIs may change before 1.0.

Author: Pankaj Jadhav · GitHub · License: MIT


Positioning (read this first)

Guarantee Behavior
Single-table sync Code-first never drops other tables; only the named table is created/altered
Additive scaffold Writing Orders.cs does not delete Customers.cs
Additive DbContext Scaffolding one table with context merges that table’s DbSet / Fluent config; other entities stay
Not a migration framework No migration history, no full-schema rewrite, no AutoMapper

Install

Pick only the database you use:

dotnet add package SoloTable.Sqlite
dotnet add package SoloTable.MySql        # MySQL + MariaDB
dotnet add package SoloTable.PostgreSql
dotnet add package SoloTable.SqlServer
dotnet add package SoloTable.Oracle
dotnet add package SoloTable.Firebird

Preview packages require a matching version (or --prerelease):

dotnet add package SoloTable.MySql --version 0.1.0-preview.3
Package Facade
SoloTable.Sqlite SqliteFacade.Connect(cs)
SoloTable.MySql MySqlFacade.Connect(cs)
SoloTable.PostgreSql PostgreSqlFacade.Connect(cs)
SoloTable.SqlServer SqlServerFacade.Connect(cs)
SoloTable.Oracle OracleFacade.Connect(cs)
SoloTable.Firebird FirebirdFacade.Connect(cs)

Connection strings

SQLite:      Data Source=app.db
MySQL:       Server=localhost;Port=3306;Database=mydb;Uid=root;Pwd=secret;
PostgreSQL:  Host=localhost;Port=5432;Database=mydb;Username=postgres;Password=secret
SQL Server:  Server=localhost;Database=mydb;Trusted_Connection=True;TrustServerCertificate=True
Oracle:      User Id=scott;Password=tiger;Data Source=localhost:1521/XEPDB1
Firebird:    Database=app.fdb;User=SYSDBA;Password=masterkey;DataSource=localhost

Code-first (C# → database) — one table

Create or alter one table from a CLR type or a fluent definition.

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using SoloTable;
using SoloTable.MySql; // or Sqlite / PostgreSql / SqlServer / ...

[Table("Orders")]
public class Order
{
    [Key]
    public long Id { get; set; }

    [Required, MaxLength(100)]
    public string CustomerName { get; set; } = "";
}

var db = MySqlFacade.Connect(
    "Server=localhost;Port=3306;Database=mydb;Uid=root;Pwd=secret;");

// From entity type — only table "Orders"
await db.CodeFirst().Entity<Order>().SyncAsync();

// One-shot helper
await db.CodeFirst().EnsureAsync<Order>();

// Fluent definition (no entity class required)
await db.CodeFirst()
    .Table("Orders")
    .Define(t => t
        .Column("Id", ColumnDbType.Int64, c => c.PrimaryKey(identity: true))
        .Column("CustomerName", ColumnDbType.String, c => c.NotNull().MaxLength(100))
        .Column("Notes", ColumnDbType.String, c => c.Nullable()))
    .SyncAsync();

// Dry-run: generate SQL without executing
var sql = await db.CodeFirst().Entity<Order>().GenerateScriptAsync();

Adding a property on Order and calling SyncAsync() again only alters that table (additive by default).


DB-first (database → C#) — additive scaffold

Single table (POCO)

Inspect or scaffold a partial POCO from one existing table. Writing one file never deletes others.

var db = MySqlFacade.Connect(connectionString);

var live = await db.DbFirst().Table("Orders").InspectAsync();

var scaffold = await db.DbFirst()
    .Table("Orders")
    .Scaffold()
    .WithNamespace("MyApp.Models")
    .WithDataAnnotations()
    .GenerateAsync();

Console.WriteLine(scaffold.SourceCode);

await db.DbFirst()
    .Table("Orders")
    .GenerateToFileAsync("Orders.cs");

db.Scaffold("Orders") is a shorthand for db.DbFirst().Table("Orders").Scaffold().

EF Core model (partial entities + DbContext + Fluent API)

Generated code targets EF Core. Add Microsoft.EntityFrameworkCore and your EF database provider in the consuming app.

Multi-table — entities + DbContext / OnModelCreating (still additive on disk: only listed tables’ files are written/updated):

await db.DbFirst()
    .Tables("Customers", "Orders")   // or .Schema() for all tables
    .ScaffoldEf()
    .WithNamespace("MyApp.Data")
    .WithContextName("AppDbContext")
    .WithDataAnnotations()
    .GenerateToDirectoryAsync("./Generated");

Single-table EF scaffold is additive — updates only that entity file, and if context generation is enabled, merges that table’s DbSet / Fluent config into the existing DbContext (other entities stay):

await db.DbFirst()
    .Table("Orders")
    .ScaffoldEf()
    .WithContext()          // merge into existing AppDbContext.cs
    .WithNamespace("MyApp.Data")
    .GenerateToDirectoryAsync("./Generated");

GenerateToDirectoryAsync never deletes sibling entity files, and never replaces an existing DbContext wholesale when only a subset of tables is scaffolded.

Consumers still need EF packages, for example:

dotnet add package Microsoft.EntityFrameworkCore
dotnet add package Pomelo.EntityFrameworkCore.MySql   # or Npgsql / SqlServer / ...

Round-trip

await db.CodeFirst().EnsureAsync<Order>();
await db.DbFirst().Table("Orders").GenerateToFileAsync("Generated/Order.cs");

Safety defaults

SoloTable code-first targets only the named table:

  • Never emits DROP TABLE
  • Never mutates other tables
  • DROP COLUMN and other destructive changes are skipped unless you opt in:
await db.CodeFirst()
    .Entity<Order>()
    .WithOptions(o => o.AllowDestructive = true)
    .SyncAsync();

Dry-run / script generation never executes DDL:

.WithOptions(o => o.DryRun = true)
// or
.GenerateScriptAsync()

More detail: Safety policy on GitHub


Target frameworks

  • net8.0
  • net9.0

Design notes

  • Single-table / additive scaffold by design — not a full-schema migration product
  • Facade pattern — engines and dialects stay internal
  • Release builds — assemblies are obfuscated; symbol packages are not published
  • Install one provider per app

Docs: NuGet setup · Providers · Testing · Protection · Publish

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 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 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.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on SoloTable.Core:

Package Downloads
SoloTable.CodeGen

Additive reverse-scaffold: single-table or multi-table EF Core models (partial entities, DbContext merge, Fluent API). Does not wipe other generated files.

SoloTable.PostgreSql

PostgreSQL provider for SoloTable — single-table schema sync and additive scaffold.

SoloTable.Firebird

Firebird provider for SoloTable — single-table schema sync and additive scaffold.

SoloTable.Sqlite

SQLite provider for SoloTable — single-table schema sync and additive scaffold.

SoloTable.MySql

MySQL and MariaDB provider for SoloTable — single-table schema sync and additive scaffold.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.3 105 7/22/2026
0.1.0-preview.2 98 7/22/2026
0.1.0-preview.1 104 7/22/2026