JonPSmith / EfCore.TestSupport

Tools for helping in unit testing applications that use Entity Framework Core
https://www.thereformedprogrammer.net/new-features-for-unit-testing-your-entity-framework-core-5-code/
Other
352 stars 53 forks source link

Postgre sql support for ef schema support #39

Closed chrisbbe closed 3 years ago

chrisbbe commented 3 years ago

Hi,

I'm using PostgreSQL, and want to use the EfSchemaCompare feature in the library (I use others as well).

The changes involved in introducing the design-time service for PostgreSQL was minor. But to add tests for that was a bit more complicated. The best and maybe the easiest way to create an EF Core PostgreSQL database context in a test is to use a test container, which boots up an instance of Postgresql, retrieves the connection strings, initializes the Db context, and applies the EF Core migrations on the DB. Note: Docker on the host running the tests is required.

On the other side, managing support for different .NET Frameworks and dependencies are not trivial. I ended up creating a new test project targeting .NET Core 3.1 to be able to use DotNet.TestContainers to run the tests.

JonPSmith commented 3 years ago

Hi chrisbbe,

It's always a good idea contacting someone before you do a pull request. In this case the EfCore.TestSupport can handle PostgreSQL already - see this link in the documentation.

I'm therefore going to close your pull request, plus I'm also going to make some big changes to the structure/NuGet approach to this library to support EF Core 5, so having another project isn't a good idea.