SchemaForge.Providers.SqlServer
2.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SchemaForge.Providers.SqlServer --version 2.0.1
NuGet\Install-Package SchemaForge.Providers.SqlServer -Version 2.0.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="SchemaForge.Providers.SqlServer" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SchemaForge.Providers.SqlServer" Version="2.0.1" />
<PackageReference Include="SchemaForge.Providers.SqlServer" />
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 SchemaForge.Providers.SqlServer --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SchemaForge.Providers.SqlServer, 2.0.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 SchemaForge.Providers.SqlServer@2.0.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=SchemaForge.Providers.SqlServer&version=2.0.1
#tool nuget:?package=SchemaForge.Providers.SqlServer&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SchemaForge
A high-performance, cross-database migration tool for .NET that migrates schemas and data between different database systems. Designed for enterprise-scale moves, SchemaForge handles complex views, cross-schema foreign keys, and massive datasets with ease.
Supported Databases
- SQL Server (source and target)
- PostgreSQL (source and target)
- MySQL (source and target)
- Oracle (source and target)
Features
- Robust Schema Migration - Automatic creation of tables, primary keys, and complex foreign key relationships across all 4 platforms.
- Enterprise-Grade Constraints - Implements "Future Enforcement, Past Forgiveness" model using
ENABLE NOVALIDATE(Oracle),NOT VALID(Postgres), andWITH NOCHECK(SQL Server) to ensure migrations complete even with legacy data orphans. - Automated Infrastructure - Automatically creates target databases, schemas, and Oracle users/permissions on-the-fly.
- High-Performance Data Transfer - Parallel table migration with batched bulk writes, read-ahead pipelines, and
sql_log_bin=0(MySQL) for maximum speed and disk efficiency. - Intelligent View Migration - Sophisticated SQL dialect conversion for view definitions, handling complex functions like
DECODE,BITAND,SYSDATETIME, and varied quoting styles. - Verified with WideWorldImporters - Stress-tested and verified using the full, multi-schema production dataset from Microsoft.
- Plugin-Based Architecture - Fully extensible provider model built on .NET 9 and standard interfaces.
- Dry Run Mode - Generate and preview complete migration SQL scripts without executing against the target.
Quick Start
Install as a .NET global tool
# Install from NuGet
dotnet tool install --global SchemaForge.Cli
# Run a migration
schemaforge --from postgres --to oracle \
--source-conn "Host=127.0.0.1;Database=prod;Username=pg;Password=..." \
--target-conn "User Id=system;Password=...;Data Source=127.0.0.1:1521/FREEPDB1" \
--schema SALES --verbose
Use as a library in your .NET app
dotnet add package SchemaForge
dotnet add package SchemaForge.Providers.SqlServer
dotnet add package SchemaForge.Providers.Postgres
using SchemaForge.Builder;
await DbMigrate
.FromSqlServer(srcConn)
.ToPostgres(targetConn, "public")
.MigrateAll()
.WithMaxParallelTables(4)
.ExecuteAsync();
CLI Usage
| Option | Type | Default | Description |
|---|---|---|---|
--from |
string | - | Source DB type: sqlserver, postgres, mysql, oracle |
--to |
string | - | Target DB type: sqlserver, postgres, mysql, oracle |
--schema |
string | public |
Target schema name |
--parallel |
int | 4 |
Max parallel table migrations |
--batch-size |
int | 10000 |
Rows per batch |
--drop-target |
flag | false |
Wipe target schemas before starting |
Data Type Mapping
| SQL Server | PostgreSQL | MySQL | Oracle |
|---|---|---|---|
tinyint |
boolean |
TINYINT(1) |
NUMBER(3) |
bit |
boolean |
TINYINT(1) |
NUMBER(1) |
varchar(n) |
character varying(n) |
VARCHAR(n) |
VARCHAR2(n) |
datetime2 |
timestamp |
DATETIME |
TIMESTAMP |
Changelog
v2.0.1 — Enterprise Resilience Update
- Major Release — Full 12-path verification matrix complete with WWI dataset.
- Robust FKs — Implemented
ENABLE NOVALIDATE(Oracle),NOT VALID(Postgres), andWITH NOCHECK(SQL Server). - MySQL Driver Upgrade — Switched to
MySqlConnectorfor superior Docker/SSL stability. - Infrastructure Automation — Added
EnsureDatabaseExistsAsyncfor SQL Server and MySQL. - Dialect Expansion — Added support for
BITAND,DECODE, andFROM_TZtranslations. - API Enhancement — New
WithMaxParallelTables(n)andWithSourceSchemaFilterfluent methods. - Performance — Implemented
sql_log_bin=0for MySQL to prevent "Disk Full" errors during large moves. - Bug Fixes — Fixed 15+ critical bugs in view routing, regex backreferences, and identifier quoting.
v1.0.51
- Fixed SQL Server to SQL Server migration issues and cross-schema FK references.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.Data.SqlClient (>= 6.1.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
- Microsoft.Extensions.Options (>= 10.0.2)
- SchemaForge.Abstractions (>= 2.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.