fix: upstream schema required property count#146
Merged
JerrettDavis merged 47 commits intomainfrom Apr 15, 2026
Merged
Conversation
…incompatible files. Also updated glob to include all generated subfolders.
…also considered to help avoid path overlap.
…ntainability (#3) * refactor: apply PatternKit patterns to MSBuild tasks for improved maintainability Refactored EnsureDacpacBuilt, ResolveSqlProjAndInputs, and RunEfcpt tasks using declarative PatternKit patterns (Strategy, ResultChain, Composer, Decorator) to improve code readability, maintainability, and testability. Key improvements: - Created 5 shared utilities (CommandNormalizationStrategy, FileResolutionChain, DirectoryResolutionChain, TaskExecutionDecorator, EnumerableExtensions) - Refactored EnsureDacpacBuilt with Strategy patterns for build tool selection and DACPAC staleness detection - Added automatic support for modern Microsoft.Build.Sql SDK projects using 'dotnet build' instead of 'dotnet msbuild' - Refactored ResolveSqlProjAndInputs with Strategy for sqlproj validation, ResultChain for multi-tier file/directory resolution, and Composer for functional state building - Transformed imperative logic into declarative when/then chains across all tasks - Replaced helper methods with functional LINQ pipelines - Introduced immutable record structs for context objects - Eliminated code duplication through shared strategies - Updated `RunEfcpt` Task to utilize `dnx` per (#1) to avoid need for manually install or include Efcpt CLI project or global dependency on .NET10+ * fix: updated builds to include peer dependencies during packaging.
…gineering from a running MSSQL server database (#6)
* docs: add documentation and docfx generation
…nerated files. (#10)
… for data-domain model segregation (#14) * feat: added the ability to split model generation across two projects for data-domain model segregation - Updated README and split-outputs documentation to clarify project roles (#11, #12). - Modified DbContext template to skip foreign keys without navigation properties. - Adjusted project file configurations for Models and Data projects to improve clarity and functionality. - Updated built-in templates to be version aware. - Updated default efcpt-config.json to not exclude all objects (#16)
…tional database providers (#17) * refactor: improve task execution and logging structure - Refactored task execution to utilize a decorator pattern for better exception handling and logging. - Simplified process execution with a new `ProcessRunner` class for consistent logging and error handling. - Enhanced resource resolution chains for files and directories, consolidating logic and improving maintainability. - Updated various tasks to leverage the new logging and execution patterns. * feat(config): add support for MSBuild property overrides in efcpt-config.json * feat(providers): add multi-database provider support for connection string mode Add support for all efcpt-supported database providers in connection string mode: - PostgreSQL (Npgsql) - MySQL/MariaDB (MySqlConnector) - SQLite (Microsoft.Data.Sqlite) - Oracle (Oracle.ManagedDataAccess.Core) - Firebird (FirebirdSql.Data.FirebirdClient) - Snowflake (Snowflake.Data) Key changes: - Create DatabaseProviderFactory for connection/reader creation - Implement provider-specific schema readers using GetSchema() API - Add SQLite sample demonstrating connection string mode - Add comprehensive samples README documenting all usage patterns - Fix MSBuild target condition timing for connection string mode - Add 77 new unit tests for schema reader parsing logic - Update documentation with provider configuration examples * refactor: address PR review comments - Use explicit LINQ filtering instead of foreach with continue - Simplify GetExistingColumn methods using FirstOrDefault - Use pattern matching switch for version parsing logic - Remove unused isPrimaryKey variable in SqliteSchemaReader - Simplify nullable boolean expressions in tests * fix: use string.Equals for fingerprint comparisons in integration tests Replace == and != operators with string.Equals() using StringComparison.Ordinal to address "comparison of identical values" code analysis warnings. * test: add coverage for NullBuildLog, Firebird, and Oracle schema readers - Add NullBuildLog unit tests to cover all IBuildLog methods - Add Testcontainers-based integration tests for FirebirdSchemaReader - Add Testcontainers-based integration tests for OracleSchemaReader - Add Testcontainers.FirebirdSql and Testcontainers.Oracle packages Note: Snowflake integration tests cannot be added as it is a cloud-only service requiring a real account. The existing unit tests cover parsing logic. * docs: add security documentation for SQLite EscapeIdentifier method Address PR review comment by documenting: - Why PRAGMA commands require embedded identifiers (no parameterized query support) - Security context: identifier values come from SQLite's internal metadata - The escaping mechanism protects against special characters in names * fix: pin Testcontainers to 4.4.0 and improve integration test assertions - Downgrade all Testcontainers packages to 4.4.0 for cross-package compatibility (Testcontainers.FirebirdSql 4.4.0 requires matching versions for core library) - Update Firebird and Oracle integration test assertions to use >= 3 instead of == 3 (some database containers may include additional tables beyond the test schema) - Add explicit checks for test tables to ensure schema reader works correctly * feat: add Snowflake integration tests with LocalStack emulator - Add SnowflakeSchemaIntegrationTests using LocalStack Snowflake emulator - Tests skip automatically when LOCALSTACK_AUTH_TOKEN is not set - Add Xunit.SkippableFact package for runtime test skipping - Tests cover schema reading, fingerprinting, and factory patterns Note: LocalStack Snowflake requires a paid token. Tests will run when LOCALSTACK_AUTH_TOKEN environment variable is set, otherwise skip gracefully. * docs: update documentation for multi-database and multi-SDK support - Update samples/README.md to clarify both Microsoft.Build.Sql and MSBuild.Sdk.SqlProj SDKs are supported for DACPAC mode - Fix main README.md: remove outdated "Phase 1 supports SQL Server only" references and update provider support table to show all 7 supported databases (SQL Server, PostgreSQL, MySQL, SQLite, Oracle, Firebird, Snowflake) - Update getting-started.md with multi-database provider examples - Update core-concepts.md with SQL SDK comparison table * refactor: use StringExtensions consistently across schema readers Replace verbose string comparison patterns with extension methods: - `string.Equals(a, b, StringComparison.OrdinalIgnoreCase)` → `a.EqualsIgnoreCase(b)` - `row["col"].ToString() == "YES"` → `row.GetString("col").EqualsIgnoreCase("YES")` Updated files: - SqlServerSchemaReader.cs - PostgreSqlSchemaReader.cs - MySqlSchemaReader.cs - OracleSchemaReader.cs - FirebirdSchemaReader.cs - SnowflakeSchemaReader.cs
…onfig properties, and generated files (#26)
* feat: add JD.Efcpt.Sdk MSBuild SDK package and documentation - Add JD.Efcpt.Sdk as MSBuild SDK for cleaner project integration - Create sdk-zero-config sample demonstrating SDK usage - Extract FileSystemHelpers utility class for code reuse - Add comprehensive SDK integration tests - Update all documentation with SDK approach as primary option - Fix troubleshooting docs for multi-provider support - Clarify CI/CD docs for cross-platform DACPAC builds
* test: add critical regression tests for build package behavior and model generation * feat: add compatibility layer for .NET Framework support This update introduces a compatibility layer for .NET Framework, allowing the project to utilize polyfills for APIs not available in .NET Framework 4.7.2. The changes include conditional compilation directives and the addition of helper methods to ensure compatibility across different target frameworks. * feat: enhance process execution with timeout handling and SQLite initialization - Added timeout handling for process execution to prevent indefinite waits. - Introduced SQLitePCL initialization for Microsoft.Data.Sqlite tests. - Updated project dependencies to include SQLitePCLRaw for SQLite support.
… Full Framework failures (#35)
On .NET Framework MSBuild hosts, certain properties like ProjectDirectory, ProjectReferences, and other MSBuild-set values may be null instead of empty strings. This caused NullReferenceExceptions in: - PathUtils.FullPath when baseDir was null - ResolveSqlProjWithValidation when ProjectReferences or ItemSpec was null - ResourceResolutionChain when searching directories with null paths - ConnectionStringResolutionChain when checking for config files with null directory This fix adds defensive null checks to handle these edge cases, ensuring the build works correctly on both .NET Framework and .NET Core MSBuild hosts.
…n .NET Framework (#38)
…work compatibility (#40)
…ion (#48) * refactor: consolidate schema readers and add comprehensive documentation - Extract common functionality into SchemaReaderBase class - Consolidate duplicate code across MySql, PostgreSql, and SqlServer schema readers - Add architecture documentation (pipeline, fingerprinting, overview) - Add use-case documentation (CI/CD patterns, enterprise usage) - Add large-schema case study - Update CONTRIBUTING.md with development guidelines
…ttern (#52) * Add core SqlProj generation tasks and MSBuild properties - Added RunSqlPackage task to extract database schema using sqlpackage - Added GenerateSqlProj task to create .sqlproj/.csproj/.fsproj files - Added MSBuild properties for SqlProj generation configuration - Registered new tasks in targets file - Added pipeline targets for SqlProj generation workflow * Refine SqlProj generation pipeline - Modified targets to properly pass extracted DACPAC to EF Core generation - Added EfcptGenerateSqlProjFile property for optional project file generation * Add database-first SqlProj generation sample - Created comprehensive sample demonstrating Database → DACPAC → EF Core Models workflow - Added detailed README explaining the new database-first approach - Sample includes EntityFrameworkCoreProject with EfcptGenerateSqlProj enabled - Documented configuration options and comparison with traditional workflow * Add schema fingerprinting for SqlProj generation - Added EfcptQueryDatabaseSchemaForSqlProj target to compute schema fingerprint before extraction - Schema fingerprint enables incremental builds - DACPAC only extracted when database schema changes - Set _EfcptUseConnectionString flag to integrate with existing fingerprinting logic - Ensures deterministic, fast builds for database-first workflow * Update README with database-first SqlProj generation feature - Added Database-First SqlProj Generation section highlighting the new capability - Updated Key Features list to include schema extraction - Added new sample to the samples list - Documented workflow: Live Database → DACPAC → EF Core Models * Implement proper database-first SqlProj generation with SQL scripts - Use sqlpackage /Action:Extract /p:ExtractTarget=Flat to extract individual SQL scripts - Generate properly structured SQL projects with organized folder hierarchy - Add auto-generation warning headers to all SQL files - Implement lifecycle hooks: BeforeSqlProjGeneration, AfterSqlProjGeneration, BeforeEfcptGeneration, AfterEfcptGeneration - Build generated SQL project to DACPAC for EF Core model generation - Workflow: Database → SQL Scripts → SqlProj → DACPAC → EF Core Models - SQL project serves as human-readable artifact that can be extended - .NET Framework 4.7.2 compatibility for relative path calculation
…over MSBuild properties (#58)
…ma change Merged origin/main (through 4880f6a) and bumped the expected code-generation property count from 12 to 13 to account for use-stored-procedure-resultset-fallback being added as a required property in the upstream schema update. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #146 +/- ##
==========================================
+ Coverage 80.87% 88.61% +7.74%
==========================================
Files 61 61
Lines 3848 3848
Branches 558 470 -88
==========================================
+ Hits 3112 3410 +298
+ Misses 511 438 -73
+ Partials 225 0 -225
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.