PureQL.CSharp.Model.Graph.Neo4j.Abstractions
0.1.0-preview.1.0.0
See the version list below for details.
dotnet add package PureQL.CSharp.Model.Graph.Neo4j.Abstractions --version 0.1.0-preview.1.0.0
NuGet\Install-Package PureQL.CSharp.Model.Graph.Neo4j.Abstractions -Version 0.1.0-preview.1.0.0
<PackageReference Include="PureQL.CSharp.Model.Graph.Neo4j.Abstractions" Version="0.1.0-preview.1.0.0" />
<PackageVersion Include="PureQL.CSharp.Model.Graph.Neo4j.Abstractions" Version="0.1.0-preview.1.0.0" />
<PackageReference Include="PureQL.CSharp.Model.Graph.Neo4j.Abstractions" />
paket add PureQL.CSharp.Model.Graph.Neo4j.Abstractions --version 0.1.0-preview.1.0.0
#r "nuget: PureQL.CSharp.Model.Graph.Neo4j.Abstractions, 0.1.0-preview.1.0.0"
#:package PureQL.CSharp.Model.Graph.Neo4j.Abstractions@0.1.0-preview.1.0.0
#addin nuget:?package=PureQL.CSharp.Model.Graph.Neo4j.Abstractions&version=0.1.0-preview.1.0.0&prerelease
#tool nuget:?package=PureQL.CSharp.Model.Graph.Neo4j.Abstractions&version=0.1.0-preview.1.0.0&prerelease
PureQL.CSharp.Model.Graph.Neo4j.Abstractions
The Neo4j stored-queries contract shared by the PureQL graph storage packages.
Overview
PureQL.CSharp.Model.Graph.Neo4j.Abstractions is the small package that the Neo4j operation packages of the PureQL.CSharp.Model.Graph family share: one description of the Neo4j database holding PureQL query graphs and one record of a stored query. The operation packages depend on it instead of on each other, so a consumer can combine any of them over the same database.
Public API
Namespace PureQL.CSharp.Model.Graph.Neo4j.Abstractions:
| Name | Description |
|---|---|
INeo4jStoredQueries |
A Neo4j database holding PureQL query graphs: the IDriver Driver connected to the server and the string Database name |
Neo4jStoredQueries |
sealed record Neo4jStoredQueries(IDriver Driver, string Database), the implementation; new Neo4jStoredQueries(driver) uses Neo4jStoredQueries.DefaultDatabase, "neo4j", the only user database on Community edition |
StoredQuery |
sealed record StoredQuery(Guid Id, PureQLQuery Query): a query as stored, with its id |
Neo4jStoredQueries does not own its driver: whoever creates the IDriver disposes it.
How the operation packages use it
Each operation package exposes statements (a Neo4j.Driver.Query: Cypher text and parameters), records that run them on an IAsyncQueryRunner, and convenience records over INeo4jStoredQueries that open a session on Driver against Database themselves. Both IAsyncSession and IAsyncTransaction are IAsyncQueryRunners, so operations from different packages compose inside one transaction:
using Neo4j.Driver;
using PureQL.CSharp.Model;
using PureQL.CSharp.Model.Graph.Neo4j.Abstractions;
await using IDriver driver = GraphDatabase.Driver(
"neo4j://localhost:7687",
AuthTokens.Basic("neo4j", "password")
);
INeo4jStoredQueries store = new Neo4jStoredQueries(driver);
PureQLQuery query = /* any PureQL query */;
StoredQuery stored = new StoredQuery(Guid.NewGuid(), query);
// One package's convenience record opens the session itself:
await new InsertedQueryOf(store, stored).ApplyAsync();
// Or compose several operations in one transaction, here to swap it for another:
StoredQuery replacement = new StoredQuery(Guid.NewGuid(), /* another query */);
await using IAsyncSession session = driver.AsyncSession(
builder => builder.WithDatabase(store.Database)
);
await session.ExecuteWriteAsync(
async transaction =>
{
await new DeletedQuery(transaction, stored.Id).ApplyAsync();
await new InsertedQuery(transaction, replacement).ApplyAsync();
}
);
InsertedQueryOf, InsertedQuery and DeletedQuery come from PureQL.CSharp.Model.Graph.Neo4j.Insertion and PureQL.CSharp.Model.Graph.Neo4j.Deletion; this package itself contains no operation.
Design Principles
- Contract only — no I/O; the records hold their values and nothing else
- AOT-compatible —
IsAotCompatible=true
Dependencies
PureQL.CSharp.Model0.1.0-preview.14.0.0—PureQLQueryNeo4j.Driver6.5.1—IDriver
Target Frameworks
- .NET 11
Installation
dotnet add package PureQL.CSharp.Model.Graph.Neo4j.Abstractions
Related packages
PureQL.CSharp.Model.Graph— maps aPureQLQueryto a property graph and back, without a driverPureQL.CSharp.Model.Graph.Neo4j.Creation— constraints and indexesPureQL.CSharp.Model.Graph.Neo4j.Insertion— writes a queryPureQL.CSharp.Model.Graph.Neo4j.Querying— reads queries backPureQL.CSharp.Model.Graph.Neo4j.Deletion— deletes queriesPureQL.CSharp.Model.Graph.Neo4j.Updating— replaces a query in one transactionPureQL.CSharp.Model.Graph.Neo4j.Existence— checks the schema and queries existPureQL.CSharp.Model.Graph.Neo4j.Destruction— drops the schema and every stored queryPureQL.CSharp.Model.Graph.Neo4j.Migration— migrates stored graphs between model versionsPureQL.CSharp.Model.Serialization— JSON for the same model
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Neo4j.Driver (>= 6.5.1)
- PureQL.CSharp.Model (>= 0.1.0-preview.14.0.0)
NuGet packages (8)
Showing the top 5 NuGet packages that depend on PureQL.CSharp.Model.Graph.Neo4j.Abstractions:
| Package | Downloads |
|---|---|
|
PureQL.CSharp.Model.Graph.Neo4j.Insertion
Inserts PureQL query graphs into Neo4j: one query, one transaction, one batched Cypher statement. |
|
|
PureQL.CSharp.Model.Graph.Neo4j.Deletion
Deletes PureQL query graphs from Neo4j by query id or by a set of ids. |
|
|
PureQL.CSharp.Model.Graph.Neo4j.Querying
Reads PureQL query graphs from Neo4j by id, by ids or all, with structural lookups, rebuilding the PureQLQuery. |
|
|
PureQL.CSharp.Model.Graph.Neo4j.Creation
Creates the Neo4j schema for PureQL query graphs: the uniqueness constraint and the indexes, applied idempotently. |
|
|
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.1.1.0 | 168 | 11/11/2026 |
| 0.1.0-preview.1.0.0 | 218 | 11/9/2026 |
| 0.1.0-preview.0.1.0 | 55 | 11/9/2026 |