linksplatform / Data.Doublets

LinksPlatform's Platform.Data.Doublets Class Library
https://linksplatform.github.io/Data.Doublets/
The Unlicense
14 stars 6 forks source link
associative-model linksplatform

Gitpod

NuGet Version and Downloads count Actions Status Codacy Badge CodeFactor

Data.Doublets (русская версия)

LinksPlatform's Platform.Data.Doublets Class Library.

Namespace: Platform.Data.Doublets

Forked from: Konard/LinksPlatform/Platform/Platform.Data.Doublets

NuGet package: Platform.Data.Doublets

Example | Run .NET fiddle

using System;
using Platform.Data;
using Platform.Data.Doublets;
using Platform.Data.Doublets.Memory.United.Generic;

// A doublet links store is mapped to "db.links" file:
using var links = new UnitedMemoryLinks<uint>("db.links");

// A creation of the doublet link: 
var link = links.Create();

// The link is updated to reference itself twice (as a source and a target):
link = links.Update(link, newSource: link, newTarget: link);

// Read operations:
Console.WriteLine($"The number of links in the data store is {links.Count()}.");
Console.WriteLine("Data store contents:");
var any = links.Constants.Any; // Means any link address or no restriction on link address
// Arguments of the query are interpreted as restrictions
var query = new Link<uint>(index: any, source: any, target: any);
links.Each((link) => {
    Console.WriteLine(links.Format(link));
    return links.Constants.Continue;
}, query);

// The link's content reset:
link = links.Update(link, newSource: default, newTarget: default);

// The link deletion:
links.Delete(link);

SQLite vs Doublets

Image with result of performance comparison between SQLite and Doublets.

Documentation

PDF file with code for e-readers.

Dependency graph [C#]

C# dependency graph SVG image

Dependency graph [C++]

C++ dependency graph SVG image

Depend on

Support

Ask questions at stackoverflow.com/tags/links-platform (or with tag links-platform) to get our free support.

You can also get real-time support on our official Discord server.