Expose default collation through the public initializers#174
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThree SQLite code-first database initializer classes ( ChangesDefault Collation Support for DB Initializers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@SQLite.CodeFirst.Test/UnitTests/DbInitializers/InitializerDefaultCollationTest.cs`:
- Around line 1-4: The file is missing an import for the SQLite.CodeFirst
namespace. The code references types such as History (used in typeof(History)),
Collation, and CollationFunction.RTrim which are all defined in the
SQLite.CodeFirst namespace but are not currently imported. Add a new using
statement for SQLite.CodeFirst at the top of the file alongside the existing
using directives.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d6bd5754-ef01-4971-b17b-fdb53cf236d0
📒 Files selected for processing (4)
SQLite.CodeFirst.Test/UnitTests/DbInitializers/InitializerDefaultCollationTest.csSQLite.CodeFirst/Public/DbInitializers/SqliteCreateDatabaseIfNotExists.csSQLite.CodeFirst/Public/DbInitializers/SqliteDropCreateDatabaseAlways.csSQLite.CodeFirst/Public/DbInitializers/SqliteDropCreateDatabaseWhenModelChanges.cs
SqliteInitializerBase already accepts a default Collation and feeds it into SQL generation, but none of the three concrete initializers forwarded it, so the documented "default collation" feature was unreachable without subclassing. Add constructor overloads that pass a Collation to the base class.
43ac922 to
f1449d9
Compare
|



Summary
The README lists "default collation" as a supported feature: pass a
Collationas a constructor parameter for an initializer.SqliteInitializerBaseis fully wired for it (it accepts aCollationand feeds it intoSqliteDatabaseCreator/SqliteSqlGenerator), but none of the three concrete initializers forwarded it, leavingDefaultCollationalwaysnull. The feature was therefore unreachable without subclassing the abstract base.Changes
Added
Collation-accepting constructor overloads that forward tobase(modelBuilder, defaultCollation)on:SqliteCreateDatabaseIfNotExists—(modelBuilder, Collation)and(modelBuilder, bool, Collation)SqliteDropCreateDatabaseAlways—(modelBuilder, Collation)SqliteDropCreateDatabaseWhenModelChanges—(modelBuilder, Collation)and(modelBuilder, Type, Collation)All existing constructors are preserved and now chain through the new ones.
Tests
Added
InitializerDefaultCollationTestverifying each new overload forwards the collation toDefaultCollation, plus a null-default baseline. Full suite green (53 tests).