Pure.RelationalSchema.Storage.PostgreSQL
0.1.0-preview.9.2.0
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
<PackageReference Include="Pure.RelationalSchema.Storage.PostgreSQL" Version="0.1.0-preview.9.2.0" />
<PackageVersion Include="Pure.RelationalSchema.Storage.PostgreSQL" Version="0.1.0-preview.9.2.0" />
<PackageReference Include="Pure.RelationalSchema.Storage.PostgreSQL" />
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"
#:package Pure.RelationalSchema.Storage.PostgreSQL@0.1.0-preview.9.2.0
#addin nuget:?package=Pure.RelationalSchema.Storage.PostgreSQL&version=0.1.0-preview.9.2.0&prerelease
#tool nuget:?package=Pure.RelationalSchema.Storage.PostgreSQL&version=0.1.0-preview.9.2.0&prerelease
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.
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.0or later), which creates what is new in the target schema, and onPure.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
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Pure.RelationalSchema.Storage.PostgreSQL.Abstractions (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Creation (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Destruction (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Insertion (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Migration (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Querying (>= 0.1.0-preview.0.6.0)
-
net8.0
- Pure.RelationalSchema.Storage.PostgreSQL.Abstractions (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Creation (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Destruction (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Insertion (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Migration (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Querying (>= 0.1.0-preview.0.6.0)
-
net9.0
- Pure.RelationalSchema.Storage.PostgreSQL.Abstractions (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Creation (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Destruction (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Insertion (>= 0.1.0-preview.0.4.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Migration (>= 0.1.0-preview.0.1.0)
- Pure.RelationalSchema.Storage.PostgreSQL.Querying (>= 0.1.0-preview.0.6.0)
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 |