Sylin.Koan.Data.Connector.Json 0.21.0

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

Sylin.Koan.Data.Connector.Json

Persist ordinary Koan Entities in inspectable local JSON files without running a database server.

Use it

dotnet add package Sylin.Koan.Data.Connector.Json

Keep the normal Koan bootstrap and Entity API:

builder.Services.AddKoan();

public sealed class Todo : Entity<Todo>
{
    public string Title { get; set; } = "";
}

var saved = await new Todo { Title = "Ship" }.Save(ct);
var same = await Todo.Get(saved.Id, ct);

The managed default directory is data. Choose another root only when placement matters:

{
  "Koan": {
    "Data": {
      "Json": { "DirectoryPath": "state" }
    }
  }
}

Named sources use the standard source grammar and may choose their own json:DirectoryPath.

What succeeds

  • Managed/read-write use creates the directory and Entity file on the first write.
  • Every read returns a detached Entity. Editing it changes nothing until Save() succeeds.
  • A write builds a complete candidate file, replaces the target, then publishes the new live snapshot.
  • Bulk upsert and delete each perform one physical file replacement.
  • A new Koan host restores root/variant identity and managed isolation fields from disk.
  • Two source path spellings that resolve to the same canonical file share one in-process snapshot and write gate.

Boundaries and failures

  • Corrupt JSON, duplicate identities, incompatible Entity roots, and files larger than 64 MiB never become an empty successful store.
  • Read-only writes fail before filesystem mutation.
  • External requires an existing directory and Entity file; Koan never provisions either.
  • Physical Map<T> declarations reject because the connector owns one Entity-array file shape.
  • Required atomic batches and provider-bounded Entity streams reject before partial work.
  • The 1,025th canonical Entity/partition file in one host rejects; the fixed 1,024-file ceiling keeps host state finite.

Choose a database connector when

You need multi-process writers, transactions, indexes, provider-side queries, crash-recovery guarantees, files above 64 MiB, or dynamically unbounded partitions. JSON is a deliberately small local persistence floor. It does not watch for external edits after a file enters the host cache, and lexical path canonicalization does not promise to collapse every symlink alias.

Use FirstPage/Page to limit results returned to application code. AllStream and QueryStream remain unavailable because loading a whole file before yielding would not be provider-bounded streaming.

See TECHNICAL.md for the exact storage and capability contract.

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

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Sylin.Koan.Data.Connector.Json:

Package Downloads
Sylin.Koan

Tested Koan foundation bundle: core runtime, Entity data, local Communication, and the JSON connector.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.21.0 37 7/30/2026
0.20.5 124 7/24/2026
0.20.4 139 7/22/2026
0.20.3 165 7/21/2026
0.17.0 101 6/12/2026
0.8.0 100 5/16/2026