Stardust.Paradox.Data.InMemory
1.0.0-preview.7
See the version list below for details.
dotnet add package Stardust.Paradox.Data.InMemory --version 1.0.0-preview.7
NuGet\Install-Package Stardust.Paradox.Data.InMemory -Version 1.0.0-preview.7
<PackageReference Include="Stardust.Paradox.Data.InMemory" Version="1.0.0-preview.7" />
<PackageVersion Include="Stardust.Paradox.Data.InMemory" Version="1.0.0-preview.7" />
<PackageReference Include="Stardust.Paradox.Data.InMemory" />
paket add Stardust.Paradox.Data.InMemory --version 1.0.0-preview.7
#r "nuget: Stardust.Paradox.Data.InMemory, 1.0.0-preview.7"
#:package Stardust.Paradox.Data.InMemory@1.0.0-preview.7
#addin nuget:?package=Stardust.Paradox.Data.InMemory&version=1.0.0-preview.7&prerelease
#tool nuget:?package=Stardust.Paradox.Data.InMemory&version=1.0.0-preview.7&prerelease
Stardust.Paradox.Data.InMemory
A high-performance, feature-rich in-memory Gremlin graph database implementation for testing and development. Perfect for unit testing, integration testing, and rapid prototyping with graph data.
? Features
- ?? High Performance: Lightning-fast in-memory graph operations
- ?? Scenario Framework: Pre-built test data scenarios for common domains
- ?? Gremlin Compatible: Full support for Gremlin traversal language
- ?? Easy Integration: Seamless integration with existing Paradox applications
- ?? Test Friendly: Designed specifically for testing scenarios
- ?? Fluent API: Intuitive, chainable configuration methods
- ?? Performance Tracking: Built-in query performance monitoring
- ?? Zero Dependencies: No external database setup required
?? Installation
Package Manager
Install-Package Stardust.Paradox.Data.InMemory -Version 1.0.0-preview.1
.NET CLI
dotnet add package Stardust.Paradox.Data.InMemory --version 1.0.0-preview.1
PackageReference
<PackageReference Include="Stardust.Paradox.Data.InMemory" Version="1.0.0-preview.1" />
?? Quick Start
Basic Usage
using Stardust.Paradox.Data.InMemory;
// Create an empty in-memory database
var connector = InMemoryGremlinLanguageConnector.Create();
// Add some data
await connector.ExecuteAsync("g.addV('person').property('name', 'John')", new Dictionary<string, object>());
await connector.ExecuteAsync("g.addV('person').property('name', 'Jane')", new Dictionary<string, object>());
await connector.ExecuteAsync("g.V().has('name', 'John').addE('knows').to(g.V().has('name', 'Jane'))", new Dictionary<string, object>());
// Query the data
var people = await connector.ExecuteAsync("g.V().hasLabel('person')", new Dictionary<string, object>());
var friendships = await connector.ExecuteAsync("g.E().hasLabel('knows')", new Dictionary<string, object>());
Using Built-in Scenarios
using Stardust.Paradox.Data.InMemory;
// Create with pre-built social network data
var connector = InMemoryConnectorFactory.CreateSocialNetwork();
// Query immediately - data is already there!
var friends = await connector.ExecuteAsync("g.V('john').out('knows')", new Dictionary<string, object>());
var mutualFriends = await connector.ExecuteAsync("g.V('john').out('knows').where(in('knows').hasId('jane'))", new Dictionary<string, object>());
?? Built-in Scenarios
The package includes several pre-built scenarios for common testing needs:
Scenario | Description | Vertex Types | Edge Types |
---|---|---|---|
BasicSocialNetwork | Social media platform | person, post | knows, authored, likes |
SimpleECommerce | E-commerce platform | customer, product, order | purchased, contains, placed |
OrganizationHierarchy | Corporate structure | employee, department | manages, works_for, assigned_to |
UserRoleManagement | RBAC system | user, role, permission | has_role, has_permission |
GraphTraversalTest | Complex patterns | node, typeA, typeB | connects, links, self |
Scenario Factory Methods
// Convenience methods for common scenarios
var socialConnector = InMemoryConnectorFactory.CreateSocialNetwork();
var ecommerceConnector = InMemoryConnectorFactory.CreateECommerce();
var orgConnector = InMemoryConnectorFactory.CreateOrganization();
var userMgmtConnector = InMemoryConnectorFactory.CreateUserManagement();
// Generic method
var connector = InMemoryConnectorFactory.CreateWithScenario("BasicSocialNetwork");
// Multiple scenarios combined
var multiConnector = InMemoryConnectorFactory.CreateWithScenarios(
new[] { "BasicSocialNetwork", "SimpleECommerce" });
?? Advanced Configuration
Database Options
var connector = InMemoryConnectorFactory.CreateSocialNetwork(options =>
{
options.EnableDebugLogging = true; // Log all queries
options.AutoGenerateIds = true; // Auto-generate vertex/edge IDs
options.ValidateEdgeVertices = true; // Ensure vertices exist for edges
options.CaseSensitiveLabels = false; // Case-insensitive labels
options.MaxVertexCount = 10000; // Limit number of vertices
options.TrackStatistics = true; // Enable performance tracking
});
Fluent API
var connector = InMemoryGremlinLanguageConnector.Create()
.WithScenario("BasicSocialNetwork")
.WithScenario("SimpleECommerce");
// Clear and apply different scenarios
connector.ClearScenarios()
.WithScenarios("UserRoleManagement", "OrganizationHierarchy");
?? Custom Scenarios
Create your own scenarios for domain-specific testing:
public class BlogScenario : InMemoryScenarioProviderBase
{
public override string ScenarioName => "BlogPlatform";
public override string Description => "Blog platform with authors, posts, and comments";
protected override (InMemoryVertexDefinition[] vertices, InMemoryEdgeDefinition[] edges) GetScenarioData()
{
var vertices = new InMemoryVertexDefinition[]
{
new InMemoryVertexDefinition("author1", "author", Props(
("name", "Alice Writer"),
("email", "alice@blog.com")
)),
new InMemoryVertexDefinition("post1", "post", Props(
("title", "Getting Started"),
("content", "Welcome to our blog!")
))
};
var edges = new InMemoryEdgeDefinition[]
{
new InMemoryEdgeDefinition("authored", "author1", "post1")
};
return (vertices, edges);
}
}
// Register and use
InMemoryScenarioRegistry.Register(new BlogScenario());
var connector = InMemoryConnectorFactory.CreateWithScenario("BlogPlatform");
?? Testing Integration
Unit Testing
[Test]
public async Task Should_FindUserFriends()
{
// Arrange
var connector = InMemoryConnectorFactory.CreateSocialNetwork();
// Act
var friends = await connector.ExecuteAsync("g.V('john').out('knows')", new Dictionary<string, object>());
// Assert
friends.Should().HaveCount(2);
}
Integration Testing
[Test]
public async Task Should_TestComplexWorkflow()
{
// Arrange
var connector = InMemoryConnectorFactory.CreateECommerce();
// Act - Test a complete purchase workflow
var customer = await connector.ExecuteAsync("g.V('customer1')", new Dictionary<string, object>());
var cart = await connector.ExecuteAsync("g.V('customer1').out('purchased')", new Dictionary<string, object>());
// Assert
customer.Should().HaveCount(1);
cart.Should().NotBeEmpty();
}
Performance Testing
[Test]
public async Task Should_PerformWell()
{
// Arrange
var connector = InMemoryConnectorFactory.CreateSocialNetwork(options =>
{
options.TrackStatistics = true;
});
var stopwatch = Stopwatch.StartNew();
// Act
await connector.ExecuteAsync("g.V().out('knows').out('knows').dedup().count()", new Dictionary<string, object>());
stopwatch.Stop();
// Assert
stopwatch.ElapsedMilliseconds.Should().BeLessThan(100);
connector.ConsumedRU.Should().BeGreaterThan(0);
}
?? Performance & Statistics
Monitor query performance and database usage:
var connector = InMemoryConnectorFactory.CreateSocialNetwork(options =>
{
options.TrackStatistics = true;
options.EnableDebugLogging = true;
});
// Execute queries
await connector.ExecuteAsync("g.V().count()", new Dictionary<string, object>());
// Check statistics
var stats = connector.GetStatistics();
Console.WriteLine($"Vertices: {stats.VertexCount}, Edges: {stats.EdgeCount}");
Console.WriteLine($"Consumed RU: {connector.ConsumedRU}");
?? Debugging & Troubleshooting
Enable Query Logging
var connector = InMemoryConnectorFactory.CreateSocialNetwork(options =>
{
options.EnableDebugLogging = true;
});
// All queries will be logged to console
var result = await connector.ExecuteAsync("g.V().hasLabel('person')", new Dictionary<string, object>());
Inspect Database State
// Examine all vertices and edges
var allVertices = connector.GetAllVertices();
var allEdges = connector.GetAllEdges();
foreach (var vertex in allVertices)
{
Console.WriteLine($"Vertex: {vertex.Id} ({vertex.Label})");
foreach (var prop in vertex.Properties)
{
Console.WriteLine($" {prop.Key}: {prop.Value}");
}
}
?? Documentation
- Complete Testing Guide - Comprehensive guide for using in test projects
- Scenario Framework Guide - Detailed scenario creation and usage
- Implementation Summary - Technical implementation details
?? Use Cases
- Unit Testing: Test graph algorithms and traversals without external dependencies
- Integration Testing: Test complete workflows with realistic graph data
- Rapid Prototyping: Quickly build and test graph-based applications
- Educational: Learn Gremlin queries and graph concepts
- CI/CD: Fast, reliable tests in continuous integration pipelines
?? Compatibility
- .NET Standard 2.0+: Compatible with .NET Framework, .NET Core, and .NET 5+
- Gremlin Language: Supports most common Gremlin traversal operations
- Testing Frameworks: Works with xUnit, NUnit, MSTest, and others
- Stardust.Paradox: Full compatibility with existing Paradox applications
?? Contributing
Contributions are welcome! Please feel free to submit pull requests, report bugs, or suggest new features.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
?? License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
?? Related Packages
- Stardust.Paradox.Data - Core Paradox graph database framework
- Stardust.Paradox.Data.Mocker - Mocking framework for Paradox applications
Made with ?? by the Stardust team
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.3)
- Stardust.Paradox.Data (>= 2.3.16)
- System.ComponentModel.Annotations (>= 4.7.0)
- System.Text.RegularExpressions (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 0 | 9/24/2025 |
1.0.0-preview.8 | 258 | 9/17/2025 |
Preview Release 1.0.0-preview.1: Full in-memory Gremlin query execution engine with comprehensive scenario framework for test data setup. Built-in scenarios for Social Network, E-Commerce, Organization, User Management. Fluent API for easy connector creation and configuration. Custom scenario support with extensible provider pattern. High-performance graph traversals and aggregations. Complete documentation and usage examples. Compatible with .NET Standard 2.0 and higher.