Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

  • Understand the current implementation of AddSQLite extension method
  • Add compatibilityMode parameter to AddSQLite method signature
  • Update GeneratorOptions instantiation to use the compatibilityMode parameter
  • Build the project to verify no compilation errors
  • Test the changes with existing tests
  • Add comprehensive unit tests for the new parameter
  • Run code review (passed with no issues)
  • Verify no regressions (all 107 SQLite tests passed)
  • Review and finalize changes

Summary

Successfully added the compatibilityMode parameter to the AddSQLite extension method with comprehensive test coverage. All changes are backward compatible and no regressions were introduced.

Commits:

  • d7c920b: Add compatibilityMode parameter to AddSQLite extension method
  • f64d32b: Add unit tests for compatibilityMode parameter in AddSQLite extension

Test Results:

  • 6 new unit tests for the extension method (all passing)
  • 107 total SQLite tests (all passing)
  • Code review: No issues found
Original prompt

This section details on the original issue you should resolve

<issue_title>Add compatibilityMode paramter to AddSQLite extension method</issue_title>
<issue_description>See this method:

public static IMigrationRunnerBuilder AddSQLite(this IMigrationRunnerBuilder builder, bool binaryGuid = false, bool useStrictTables = false)

Original Issue below:

@zelenij The CompatibilityMode is a GeneratorOptions class member property.

public CompatibilityMode? CompatibilityMode { get; set; }

It is a good point that there is not a streamlined way to configure it. I overlooked that in my previous answer.

The SQLite DI extensions should probably add another optional parameter to make this easier:

new OptionsWrapper<GeneratorOptions>(new GeneratorOptions()));

The workaround would be to copy-paste this extension in your own solution and add the appropriate parameter:

        public static IMigrationRunnerBuilder AddSQLite(this IMigrationRunnerBuilder builder, bool binaryGuid = false, bool useStrictTables = false, CompatibilityMode compatibilityMode = CompatibilityMode.Strict)

        {

            builder.Services

                .AddTransient<SQLiteBatchParser>()

                .AddScoped<SQLiteDbFactory>()

                .AddScoped<SQLiteProcessor>(sp =>

                {

                    var factory = sp.GetService<SQLiteDbFactory>();

                    var logger = sp.GetService<ILogger<SQLiteProcessor>>();

                    var options = sp.GetService<IOptionsSnapshot<ProcessorOptions>>();

                    var connectionStringAccessor = sp.GetService<IConnectionStringAccessor>();

                    var sqliteQuoter = new SQLiteQuoter(false);

                    return new SQLiteProcessor(factory, sp.GetService<SQLiteGenerator>(), logger, options, connectionStringAccessor, sp, sqliteQuoter);

                })

                .AddScoped<ISQLiteTypeMap>(sp => new SQLiteTypeMap(useStrictTables))

                .AddScoped<IMigrationProcessor>(sp => sp.GetRequiredService<SQLiteProcessor>())

                

                .AddScoped(

                    sp =>

                    {

                        var typeMap = sp.GetRequiredService<ISQLiteTypeMap>();

                        return new SQLiteGenerator(

                            new SQLiteQuoter(binaryGuid),

                            typeMap,

                            new OptionsWrapper<GeneratorOptions>(new GeneratorOptions { CompatibilityMode = compatibilityMode  }));

                    })

                .AddScoped<IMigrationGenerator>(sp => sp.GetRequiredService<SQLiteGenerator>());



            return builder;

        }

Happy to accept a PR to streamline this as well.

The other major gap identified through this conversation is that dotnet-fm does not have a way to configure compatibilityMode.

Originally posted by @jzabroski in #1784</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jzabroski <447485+jzabroski@users.noreply.github.com>
Copilot AI changed the title [WIP] Add compatibilityMode parameter to AddSQLite extension method Add compatibilityMode parameter to AddSQLite extension method Jan 20, 2026
Copilot AI requested a review from jzabroski January 20, 2026 19:42
@jzabroski
Copy link
Collaborator

@copilot Where are the unit tests

Co-authored-by: jzabroski <447485+jzabroski@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 20, 2026

@copilot Where are the unit tests

Added comprehensive unit tests in commit f64d32b. The test suite includes 6 test cases covering:

  • Default behavior (null → STRICT)
  • Explicit STRICT mode
  • Explicit LOOSE mode
  • Interaction with other parameters (binaryGuid, useStrictTables)
  • All parameters combined

All tests pass successfully.

@github-actions
Copy link

Test Results

    2 files  ±0      2 suites  ±0   40s ⏱️ +2s
5 463 tests ±0  5 131 ✅ ±0  332 💤 ±0  0 ❌ ±0 
5 947 runs  ±0  5 351 ✅ ±0  596 💤 ±0  0 ❌ ±0 

Results for commit f64d32b. ± Comparison against base commit 06fb0de.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add compatibilityMode parameter to AddSQLite extension method

2 participants