PureQL.CSharp.Model.Graph.Neo4j.Deletion 0.1.0-preview.0.1.0

This is a prerelease version of PureQL.CSharp.Model.Graph.Neo4j.Deletion.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package PureQL.CSharp.Model.Graph.Neo4j.Deletion --version 0.1.0-preview.0.1.0
                    
NuGet\Install-Package PureQL.CSharp.Model.Graph.Neo4j.Deletion -Version 0.1.0-preview.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="PureQL.CSharp.Model.Graph.Neo4j.Deletion" Version="0.1.0-preview.0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PureQL.CSharp.Model.Graph.Neo4j.Deletion" Version="0.1.0-preview.0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PureQL.CSharp.Model.Graph.Neo4j.Deletion" />
                    
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 PureQL.CSharp.Model.Graph.Neo4j.Deletion --version 0.1.0-preview.0.1.0
                    
#r "nuget: PureQL.CSharp.Model.Graph.Neo4j.Deletion, 0.1.0-preview.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.
#:package PureQL.CSharp.Model.Graph.Neo4j.Deletion@0.1.0-preview.0.1.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=PureQL.CSharp.Model.Graph.Neo4j.Deletion&version=0.1.0-preview.0.1.0&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=PureQL.CSharp.Model.Graph.Neo4j.Deletion&version=0.1.0-preview.0.1.0&prerelease
                    
Install as a Cake Tool

PureQL.CSharp.Model.Graph.Neo4j.Deletion

Deletes PureQL query graphs stored in Neo4j.

.NET build & test Build and Deploy NuGet License: MIT

Overview

PureQL.CSharp.Model.Graph.Neo4j.Deletion is the deletion package of the PureQL.CSharp.Model.Graph family. A query stored by PureQL.CSharp.Model.Graph is a graph of Nodes that all carry the query's id as queryId; deleting the query detaches and deletes every one of them.

Public API

Namespace PureQL.CSharp.Model.Graph.Neo4j.Deletion:

Name Description
DeleteByIdStatement sealed record DeleteByIdStatement(Guid Id); Value is the Neo4j.Driver.Query MATCH (n:Node {queryId: $id}) DETACH DELETE n
DeleteByIdsStatement sealed record DeleteByIdsStatement(IReadOnlyCollection<Guid> Ids); Value is the Neo4j.Driver.Query MATCH (n:Node) WHERE n.queryId IN $ids DETACH DELETE n
DeletedQuery sealed record DeletedQuery(IAsyncQueryRunner Runner, Guid Id); ApplyAsync runs DeleteByIdStatement on the runner
DeletedQueries sealed record DeletedQueries(IAsyncQueryRunner Runner, IReadOnlyCollection<Guid> Ids); ApplyAsync runs DeleteByIdsStatement on the runner
DeletedQueryOf sealed record DeletedQueryOf(INeo4jStoredQueries Store, Guid Id); ApplyAsync opens a session on Store.Driver against Store.Database and runs DeletedQuery in ExecuteWriteAsync
DeletedQueriesOf sealed record DeletedQueriesOf(INeo4jStoredQueries Store, IReadOnlyCollection<Guid> Ids); the same for DeletedQueries
  • Ids are passed in the Guid "D" format, as the Graph package writes queryId.
  • Deleting what is not stored is a no-op: an unknown id matches nothing, and an empty set deletes nothing.
  • DeletedQuery and DeletedQueries run on any IAsyncQueryRunner, so a deletion composes with other operations inside one transaction; the ...Of records run in a write transaction of their own, which the driver retries on transient failures.
  • The driver's RunAsync takes no cancellation token: ApplyAsync checks its token before opening the session and before sending the statement.

Usage

using Neo4j.Driver;
using PureQL.CSharp.Model.Graph.Neo4j.Abstractions;
using PureQL.CSharp.Model.Graph.Neo4j.Deletion;

await using IDriver driver = GraphDatabase.Driver(
    "neo4j://localhost:7687",
    AuthTokens.Basic("neo4j", "password")
);
INeo4jStoredQueries store = new Neo4jStoredQueries(driver);

// One query, in a transaction of its own:
await new DeletedQueryOf(store, queryId).ApplyAsync();

// The queries of a dashboard, in one statement:
await new DeletedQueriesOf(store, [firstQueryId, secondQueryId]).ApplyAsync();

// Or as part of a larger transaction:
await using IAsyncSession session = driver.AsyncSession(
    builder => builder.WithDatabase(store.Database)
);
await session.ExecuteWriteAsync(
    async transaction =>
    {
        await new DeletedQuery(transaction, queryId).ApplyAsync();
        // ...other operations on the same transaction
    }
);

Design Principles

  • Statements, then execution — the Cypher is a value you can inspect or run yourself; the executing records only send it
  • AOT-compatible — IsAotCompatible=true

Dependencies

Target Frameworks

  • .NET 11

Installation

dotnet add package PureQL.CSharp.Model.Graph.Neo4j.Deletion
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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 PureQL.CSharp.Model.Graph.Neo4j.Deletion:

Package Downloads
PureQL.CSharp.Model.Graph.Neo4j.Updating

Replaces a stored PureQL query graph in Neo4j in one transaction.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.0.2.0 95 11/11/2026
0.1.0-preview.0.1.0 85 11/9/2026