Commit 7b7cb49
authored
feat: enhance configurability of the library through MSBuild and additional 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.cs1 parent 518a7b2 commit 7b7cb49
65 files changed
Lines changed: 10411 additions & 753 deletions
File tree
- docs/user-guide
- lib
- samples
- connection-string-sqlite
- Database
- EntityFrameworkCoreProject
- Template
- CodeTemplates/EFCore
- src
- JD.Efcpt.Build.Tasks
- Chains
- Config
- Decorators
- Schema
- Providers
- JD.Efcpt.Build
- buildTransitive
- build
- tests/JD.Efcpt.Build.Tests
- Integration
- Schema
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
608 | 618 | | |
609 | 619 | | |
610 | 620 | | |
| |||
949 | 959 | | |
950 | 960 | | |
951 | 961 | | |
952 | | - | |
| 962 | + | |
953 | 963 | | |
954 | 964 | | |
955 | 965 | | |
| |||
1043 | 1053 | | |
1044 | 1054 | | |
1045 | 1055 | | |
1046 | | - | |
| 1056 | + | |
1047 | 1057 | | |
1048 | 1058 | | |
1049 | 1059 | | |
| |||
1289 | 1299 | | |
1290 | 1300 | | |
1291 | 1301 | | |
1292 | | - | |
1293 | | - | |
| 1302 | + | |
| 1303 | + | |
1294 | 1304 | | |
1295 | 1305 | | |
1296 | 1306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
183 | 265 | | |
184 | 266 | | |
185 | 267 | | |
| |||
234 | 316 | | |
235 | 317 | | |
236 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
237 | 389 | | |
238 | 390 | | |
239 | 391 | | |
| |||
733 | 885 | | |
734 | 886 | | |
735 | 887 | | |
736 | | - | |
737 | | - | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
738 | 894 | | |
739 | 895 | | |
740 | | - | |
| 896 | + | |
741 | 897 | | |
742 | 898 | | |
743 | 899 | | |
744 | 900 | | |
745 | | - | |
| 901 | + | |
746 | 902 | | |
747 | 903 | | |
748 | 904 | | |
| |||
0 commit comments