TestPrune.Sql 0.3.1

dotnet add package TestPrune.Sql --version 0.3.1
                    
NuGet\Install-Package TestPrune.Sql -Version 0.3.1
                    
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="TestPrune.Sql" Version="0.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TestPrune.Sql" Version="0.3.1" />
                    
Directory.Packages.props
<PackageReference Include="TestPrune.Sql" />
                    
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 TestPrune.Sql --version 0.3.1
                    
#r "nuget: TestPrune.Sql, 0.3.1"
                    
#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 TestPrune.Sql@0.3.1
                    
#: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=TestPrune.Sql&version=0.3.1
                    
Install as a Cake Addin
#tool nuget:?package=TestPrune.Sql&version=0.3.1
                    
Install as a Cake Tool

TestPrune.Sql

Add explicit database shared-state dependencies to a TestPrune symbol graph. When one symbol writes a table or column and another reads it, the extension adds a SharedState edge so a writer change selects tests that reach the reader. A test method is never a writer: rows a test seeds exist only inside that test, so no reader depends on them. A test that reads a table still depends on its writers.

dotnet add package TestPrune.Sql

Attribute discovery

Annotate module functions or values, then register AutoSqlExtension with the host that invokes ITestPruneExtension after indexing:

open TestPrune.Sql
open TestPrune.Extensions

[<WritesTo("public.articles", "status")>]
let markComplete connection articleId =
    // ...

[<ReadsFrom("public.articles", "status")>]
let listComplete connection =
    // ...

let extension: ITestPruneExtension =
    AutoSqlExtension() :> ITestPruneExtension

The one-argument attribute form uses the wildcard column *. A wildcard matches every column on the same table. Use schema-qualified table identities such as public.articles when facts must interoperate with TestPrune.SqlHydra; equal table names in different schemas otherwise cannot be distinguished.

For facts obtained outside source attributes, construct SqlFact values and register SqlExtension(facts) instead. Registration is explicit: merely referencing this package does not run either extension. The host stores their edges with refreshExtensionEdges on every index build.

Tests with their own database state

When every test starts from its own database state (truncated and re-seeded per test or per fixture), rows a writer stores are visible only to the test that ran the writer. A changed writer can then affect a test that reads its table only if that test also executes the writer. Open the index with the reachability-gated policy to select on that basis:

let db = TestPrune.Database.Database.create (dbPath, SqlCoupling.reachabilityGated)

A writer change then selects a test through a reader only when the test reaches the writer through its other edges: calls, routes, dispatch, or a fixture that seeds through it. The stored edges are the same under either policy. Keep the default (WalkPolicy.FollowAll) when tests share database state, for example rows written by another test or a seed snapshot built outside any test.

See the repository's integration guide for extension-host wiring and edge direction.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
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 TestPrune.Sql:

Package Downloads
TestPrune.SqlHydra

SqlHydra integration for TestPrune — automatic SQL coupling detection from typed queries

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 56 10/13/2026
0.3.0 151 9/25/2026
0.2.0 109 9/24/2026
0.1.0 181 8/28/2026