Conversation
Design for restructuring integration tests: - Remove unit-test-overlapping tests (Tags, Cache, Deserializers, etc.) - Add multi-DB support: MySQL 8, PostgreSQL 16, SQL Server 2022, SQLite - Use abstract base classes + DB-specific subclasses pattern - Use <Env> tags for DB-specific SQL fragments in maps - One init script per database
This reverts commit c9cbad9.
…Env tags for multi-DB
…ity issues - Add UseDatabase() method to SmartSqlBuilder for overriding DB provider and connection string independently from XML config (allows UseXmlConfig() + UseDatabase() chaining) - Fix SQLite in-memory DB sharing: use named memory DB (Data Source=InMemory;Mode=Memory;Cache=Shared) so Write and Read connections share the same database - Fix TimeSpanAnyTypeHandler: add string parsing for SQLite TIME columns that return 'HH:MM:SS' format - Fix SQLite SelectAutoIncrement: add ';Select last_insert_rowid();' to enable CUD auto-generated InsertReturnId - Fix DbSessionTestBase: use @ prefix for SQLite and SQL Server RealSql (matches SqlParamAnalyzer's dbPrefix) instead of $ portable prefix - Add SmartSqlMapConfig.Sqlite.xml with specific map files and read replica datasources
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #282 +/- ##
==========================================
+ Coverage 72.76% 72.86% +0.10%
==========================================
Files 314 314
Lines 7164 7180 +16
Branches 999 1007 +8
==========================================
+ Hits 5213 5232 +19
+ Misses 1719 1717 -2
+ Partials 232 231 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add ConnectionString property to SQL Server config - Use specific Map files instead of Maps directory to avoid loading T_Entity.xml (references non-existent table) - Disable cache for PostgreSQL and SQL Server (no Redis in CI)
- Create SmartSqlMapConfig.MySql.xml with disabled cache - Update MySqlFixture to use the new config - Add missing using statement for ResourceType
- Skip MySqlRedisCacheTests and MySqlUsedCacheRepositoryTests - These require Redis container which CI environment lacks
- Set IsCacheEnabled=false in default SmartSqlMapConfig.xml - Fix DI tests to use UseCache(false) to prevent Redis connection - Fix PostgreSQL init SQL: remove double quotes to match lowercase table name resolution
- Use explicit Map file list instead of Maps directory to exclude RedisCache.xml, FifoCache.xml, and LruCache.xml - Add TagTest.xml for DI tests
- Fix DbSessionTestBase to use ? prefix for MySQL (matches DbProvider) - Use @ prefix for SQLite and SQL Server - Change MySQL fixture alias to GlobalSmartSql to match ColumnAnnotationEntity's hardcoded alias reference
- Skip PostgreSQL (backtick quoting incompatibility) and SQL Server (DateTime overflow) in CI until Maps XML is updated with <Env> tags
…ypeHandler - Test UseDatabase with valid and invalid provider names - Test UseDatabase connection string override with XML config - Test UseDatabase read datasource connection string override - Test TimeSpanAnyTypeHandler for TimeSpan, Int64, string, and default conversion paths
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.
Summary
$portable parameter prefix with<Env>tags for DB-specific SQLSmartSqlBuilder.UseDatabase()to allow chaining withUseXmlConfig()Breaking Changes
Test Plan