ArgoStore 0.1.0

dotnet add package ArgoStore --version 0.1.0                
NuGet\Install-Package ArgoStore -Version 0.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="ArgoStore" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArgoStore --version 0.1.0                
#r "nuget: ArgoStore, 0.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 ArgoStore as a Cake Addin
#addin nuget:?package=ArgoStore&version=0.1.0

// Install ArgoStore as a Cake Tool
#tool nuget:?package=ArgoStore&version=0.1.0                

ArgoStore

Embedded transactional document store for .NET and .NET Core powered by Sqlite and JSON1 extension.

What is ArgoStore?

ArgoStore is a NETSTANDARD2.0 library that is using SQLite and JSON1 to store and retrieve JSON documents. It supports identity, indexes, nested objects, collections, LINQ queries, etc...

Is it stable?

Not fully. Even though it's work in progress and some features are missing (optimistic concurrency and async methods) library interfaces are mostly stable and not expected to change. Focus for future releases is on stabilizing select expressions, testing where predicates and improving performance.


Getting started


Console application (no dependency injection)

Create new project and add ArgoStore nuget reference.

dotnet add package ArgoStore

Define document type

public class Person
{
    public Guid Id { get; set; }
    public string Name { get; set; } = "";
    public int CookiesCount { get; set; }
    public string[] Roles { get; set; } = Array.Empty<string>();
}

Register document type

const string connectionString = "Data Source=c:\\temp\\mydb.sqlite";
ArgoDocumentStore store = new ArgoDocumentStore(connectionString);
store.RegisterDocument<Person>();

Insert data

using IArgoDocumentSession session = store.OpenSession();

session.Insert(new Person
{
    Name = "John Doe",
    CookiesCount = 1,
    Roles = new [] {"admin", "sales"}
});

session.SaveChanges();

Query data:

using IArgoQueryDocumentSession session = store.OpenQuerySession();

Person marco = session.Query<Person>()
    .First(x => x.Name.EndsWith("marco", StringComparison.OrdinalIgnoreCase));
Console.WriteLine($"{marco.Id}: {marco.Name}");


List<Person> sales = session.Query<Person>()
    .Where(x => x.Roles.Contains("sales"))
    .ToList();

Console.WriteLine("sales:");
foreach (Person salesPerson in sales)
{
    Console.WriteLine($"{salesPerson.Id}: {salesPerson.Name}");
}

ASP.NET Core application with default dependency injection

Create new web API application and add nuget dependency:

dotnet add package ArgoStore.Extensions.DependencyInjection

Add connection string to appsettings.json

{
  "ConnectionStrings": {
    "db": "Data Source=/path/to/db.sqlite"
  },
  "AllowedHosts": "*"
}

Edit Program.cs and register ArgoStore before var app = builder.Build(); line.

string dbConnectionString = builder.Configuration.GetConnectionString("db")
    ?? throw new InvalidOperationException("`ConnectionStrings:db` not set");

builder.Services.AddArgoStore(c =>
{
    c.ConnectionString(dbConnectionString);
    c.RegisterDocument<Person>();
});

This will register:

  • ArgoDocumentStore as singleton
  • IArgoDocumentStore as singleton
  • IArgoDocumentSession as scoped
  • IArgoQueryDocumentSession as transient

Use same session methods to query and modify documents as in console example.

For more examples see documentation.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 ArgoStore:

Package Downloads
ArgoStore.Extensions.DependencyInjection

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 329 2/17/2023
0.0.1 282 2/17/2023