Skip to content

Conversation

@AngelMunoz
Copy link
Owner

  • Replace RepoDb dependency with direct ADO.NET commands.

@AngelMunoz AngelMunoz requested a review from Copilot June 17, 2025 00:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the core database layer by removing the RepoDB dependency and replacing it with direct ADO.NET commands. Key changes include:

  • Removing RepoDB package references and corresponding open statements.
  • Refactoring both synchronous and asynchronous tests to execute ADO.NET commands explicitly.
  • Updating the getConnection API signature to return a DbConnection, enhancing type specificity.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
src/Migrondi.Tests/Database.fs Removed RepoDB imports; refactored insertion and query methods using ADO.NET commands.
src/Migrondi.Tests/Database.Async.fs Updated async test routines to use ADO.NET commands and adjusted assertions accordingly.
src/Migrondi.Core/Migrondi.Core.fsproj Removed obsolete RepoDB package references; added direct ADO.NET driver packages.
src/Migrondi.Core/Database.fsi Changed the getConnection signature to return DbConnection instead of IDbConnection.
Comments suppressed due to low confidence (3)

src/Migrondi.Tests/Database.fs:88

  • Consider wrapping the transaction.Commit() call in a try/finally or try/with block to ensure that the transaction can be rolled back if an error occurs during the insertion loop.
transaction.Commit()

src/Migrondi.Core/Database.fsi:141

  • Changing the getConnection return type from IDbConnection to DbConnection improves type safety; please verify that all consuming code seamlessly works with this change.
val getConnection: connectionString: string * driver: MigrondiDriver -> DbConnection

src/Migrondi.Tests/Database.Async.fs:392

  • Ensure that the new expected ordering for rolledBackMigrations aligns with the intended migration rollback logic and is thoroughly documented in the tests.
Assert.AreEqual<string>("test_4", rolledBackMigrations[0].name)

- Changed program paths from netcoreapp3.1 to net9.0 for all launch configurations.
- Adjusted working directory for UP and DOWN commands to point to samples/sqlite.
- Added MIGRONDI_HOME environment variable setup in profile.
- Enhanced checks to verify both PATH and MIGRONDI_HOME configurations.
- Improved logging messages for clarity on profile updates.
@AngelMunoz AngelMunoz merged commit 169b60e into vnext Jun 17, 2025
2 checks passed
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.

2 participants