Skip to content

1337101/Data.Doublets

 
 

Repository files navigation

NuGet Version and Downloads count Actions Status Codacy Badge CodeFactor

LinksPlatform's Platform.Data.Doublets Class Library.

Namespace: Platform.Data.Doublets

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

NuGet package: Platform.Data.Doublets

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);

Image with result of performance comparison between SQLite and Doublets.

PDF file with code for e-readers.

Dependency graph

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.

About

LinksPlatform's Platform.Data.Doublets Class Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%