Pure.RelationalSchema.Storage.PostgreSQL 0.1.0-preview.9.2.0

This is a prerelease version of Pure.RelationalSchema.Storage.PostgreSQL.
dotnet add package Pure.RelationalSchema.Storage.PostgreSQL --version 0.1.0-preview.9.2.0
                    
NuGet\Install-Package Pure.RelationalSchema.Storage.PostgreSQL -Version 0.1.0-preview.9.2.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="Pure.RelationalSchema.Storage.PostgreSQL" Version="0.1.0-preview.9.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.RelationalSchema.Storage.PostgreSQL" Version="0.1.0-preview.9.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.RelationalSchema.Storage.PostgreSQL" />
                    
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 Pure.RelationalSchema.Storage.PostgreSQL --version 0.1.0-preview.9.2.0
                    
#r "nuget: Pure.RelationalSchema.Storage.PostgreSQL, 0.1.0-preview.9.2.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 Pure.RelationalSchema.Storage.PostgreSQL@0.1.0-preview.9.2.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=Pure.RelationalSchema.Storage.PostgreSQL&version=0.1.0-preview.9.2.0&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Pure.RelationalSchema.Storage.PostgreSQL&version=0.1.0-preview.9.2.0&prerelease
                    
Install as a Cake Tool

Pure.RelationalSchema.Storage.PostgreSQL

PostgreSQL storage for the Pure relational schema ecosystem. This package has been split into separate packages; Pure.RelationalSchema.Storage.PostgreSQL is now a meta-package that contains no code and references all of them, and this repository aggregates their sources as submodules.

.NET build NuGet License: MIT

Packages

Package Repository Contents
Pure.RelationalSchema.Storage.PostgreSQL.Abstractions source IPostgreSqlStoredSchemaDataSet
Pure.RelationalSchema.Storage.PostgreSQL.Creation source PostgreSqlCreatedSchema (DDL)
Pure.RelationalSchema.Storage.PostgreSQL.Querying source PostgreSqlStoredSchemaDataSet, PostgreSqlStoredTableDataSet
Pure.RelationalSchema.Storage.PostgreSQL.Insertion source PostgreSqlStoredSchemaDataSetWithInsertedRows
Pure.RelationalSchema.Storage.PostgreSQL.Migration source PostgreSqlMigratedSchema, SchemaMigration, TableMapping, ColumnMapping
Pure.RelationalSchema.Storage.PostgreSQL.Destruction source PostgreSqlDroppedSchema

Installing Pure.RelationalSchema.Storage.PostgreSQL pulls in all six. To take only what you need, reference the individual packages instead.

  • Insertion and Querying depend on Abstractions; they do not depend on each other or on Creation.
  • Migration depends on Creation (0.1.0-preview.0.4.0 or later), which creates what is new in the target schema, and on Pure.RelationalSchema.Migration.Abstractions (ISchemaMigration, ITableMapping, IColumnMapping).
  • Destruction depends on none of the other packages. It finds the storage by the same schema hash that Creation uses.

Migrating from 0.1.0-preview.8.x

The last release that contained code is 0.1.0-preview.8.1.2. Every public type moved to a new namespace, so after updating the package reference you must change your using directives:

Old type New namespace
IPostgreSqlStoredSchemaDataSet Pure.RelationalSchema.Storage.PostgreSQL.Abstractions
PostgreSqlCreatedSchema Pure.RelationalSchema.Storage.PostgreSQL.Creation
PostgreSqlStoredSchemaDataSet, PostgreSqlStoredTableDataSet Pure.RelationalSchema.Storage.PostgreSQL.Querying
PostgreSqlStoredSchemaDataSetWithInsertedRows Pure.RelationalSchema.Storage.PostgreSQL.Insertion

Replace using Pure.RelationalSchema.Storage.PostgreSQL; with the namespaces above.

Behaviour change: asynchronous enumeration in Querying (await foreach over a PostgreSqlStoredTableDataSet) no longer disposes the IDbConnection you passed in. Previously the connection was closed after the first async enumeration; you now own its lifetime.

Usage

using System.Data;
using Pure.RelationalSchema.Abstractions.Schema;
using Pure.RelationalSchema.Abstractions.Table;
using Pure.RelationalSchema.Storage.Abstractions;
using Pure.RelationalSchema.Storage.PostgreSQL.Abstractions;
using Pure.RelationalSchema.Storage.PostgreSQL.Creation;
using Pure.RelationalSchema.Storage.PostgreSQL.Insertion;
using Pure.RelationalSchema.Storage.PostgreSQL.Querying;

// schema is your ISchema; connection is an open IDbConnection
ISchema createdSchema = new PostgreSqlCreatedSchema(schema, connection);

IPostgreSqlStoredSchemaDataSet dataset =
    new PostgreSqlStoredSchemaDataSet(createdSchema, connection);

IStoredTableDataSet tableDataset = dataset[myTable];
await foreach (IRow row in tableDataset)
{
    // ...
}

// rowGroups: IEnumerable<IGrouping<ITable, IRow>>
IPostgreSqlStoredSchemaDataSet withInserted =
    new PostgreSqlStoredSchemaDataSetWithInsertedRows(dataset, rowGroups);

Migrating stored data to a changed schema, and dropping a schema's storage:

using Pure.RelationalSchema.Abstractions.Schema;
using Pure.RelationalSchema.Migration.Abstractions.TableMapping;
using Pure.RelationalSchema.Storage.PostgreSQL.Destruction;
using Pure.RelationalSchema.Storage.PostgreSQL.Migration;
using IDbConnection = System.Data.IDbConnection;

// source is the stored ISchema, target its changed version.
// tableMappings: IEnumerable<ITableMapping>, needed only for changed tables and columns.
// Reading a member drops, renames, retypes and adds what changed, then creates what is new.
ISchema migratedSchema =
    new PostgreSqlMigratedSchema(source, target, tableMappings, connection);
_ = migratedSchema.Name;

// Drops the schema's storage with all its tables and data, on first member access.
_ = new PostgreSqlDroppedSchema(migratedSchema, connection).Name;

System.Data also declares ITableMapping and IColumnMapping, so alias what you need from it instead of importing the whole namespace in files that use the migration types.

Working on the packages together

The package repositories are included as submodules under modules/, pinned to their released tags, and src/Pure.RelationalSchema.Storage.PostgreSQL.slnx opens all of them in one solution.

git clone --recurse-submodules https://github.com/kudima03/Pure.RelationalSchema.Storage.PostgreSQL
cd Pure.RelationalSchema.Storage.PostgreSQL/src
dotnet build

Changes to a package are made in its own repository and released there. Dependabot bumps the submodule pointers and the meta-package's package references. Tests run in each package's repository CI.

Target Frameworks

  • .NET 8
  • .NET 9
  • .NET 10
There are no supported framework assets in this 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
0.1.0-preview.9.2.0 68 10/26/2026
0.1.0-preview.9.1.0 97 10/23/2026
0.1.0-preview.9.0.0 145 10/16/2026
0.1.0-preview.8.1.2 758 8/6/2026
0.1.0-preview.8.1.1 502 6/25/2026
0.1.0-preview.8.1.0 283 6/8/2026
0.1.0-preview.8.0.0 112 6/7/2026
0.1.0-preview.7.0.1 525 5/7/2026
0.1.0-preview.7.0.0 693 3/14/2026
0.1.0-preview.6.1.0 133 3/11/2026
0.1.0-preview.6.0.0 110 3/11/2026
0.1.0-preview.5.2.1 859 11/19/2025
0.1.0-preview.5.2.0 439 11/19/2025
0.1.0-preview.5.1.0 450 11/18/2025
0.1.0-preview.5.0.1 390 11/17/2025
0.1.0-preview.5.0.0 428 11/4/2025
0.1.0-preview.4.0.2 232 10/28/2025
0.1.0-preview.4.0.1 208 10/24/2025
0.1.0-preview.4.0.0 192 10/17/2025
0.1.0-preview.3.0.0 212 10/16/2025
Loading failed