SpanFlow.Connectors.Database 1.0.0

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

SpanFlow.Connectors.Database

One adapter interface over PostgreSQL, SQL Server, MySQL/MariaDB and SQLite. It comes from SpanFlow, where it runs every database step of a pipeline.

  • IDbProviderAdapter, one per database: opens a connection, quotes identifiers, lists tables, columns and foreign keys, and builds upserts and paging clauses in that database's own SQL.
  • DbProviderRegistry picks an adapter by name (postgres, sqlserver, mysql, sqlite). It can also wrap every adapter it hands out, for example to refuse servers your host doesn't allow.
  • QueryAdvisor.Inspect(sql) reviews a query before it runs: it flags SELECT * and a SELECT with no row limit, and suggests the fix in the right dialect (LIMIT, TOP or FETCH FIRST).
  • SqlFingerprint gives a query a canonical form, so two saved queries written differently are recognised as the same one.
using SpanFlow.Connectors.Database;

var registry = new DbProviderRegistry([new PostgresAdapter(), new SqlServerAdapter(), new MySqlAdapter(), new SqliteAdapter()]);
var sqlite = registry.Get("sqlite");

await using var connection = sqlite.CreateConnection("Data Source=app.db");
await connection.OpenAsync();
foreach (var table in await sqlite.ListTablesAsync(connection, CancellationToken.None))
{
    var columns = await sqlite.ListColumnsAsync(connection, table.QualifiedName, CancellationToken.None);
    Console.WriteLine($"{table.QualifiedName}: {string.Join(", ", columns.Select(c => c.Name))}");
}

foreach (var advice in QueryAdvisor.Inspect("SELECT * FROM orders"))
{
    Console.WriteLine($"{advice.Severity}: {advice.Message} {advice.Suggestion}");
}

Targets .NET 8, 9 and 10. MIT licensed.

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

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 79 11/9/2026