Feature request: EfCore DbContext Postgres support
The EF DbContext Connection dialog currently only supports "SQL Server" or "SQLite"
Please support other options like Postgres and/or mysql. Thanks.
Please support other options like Postgres and/or mysql. Thanks.
Comments
There are a number of third-party packages, but I would need to write separate code for each package. Unfortunately, this is how Entity Framework core has been designed.
The workaround is to use another constructor. Either create a parameterless constructor or one that accept a string and then you can put the providers-specific setup into that constructor.
It doesnt have the "Microsoft" prefix, but it is high quality and well maintained. The core contributor roj is an MS employee and works on the EFCore project.
So I think it would be ok to only support this package as this is literally the default package/project when using postgres data-access with ef core.
I do understand that this takes additional effort on your side. But I think that "Postgres+EF" should not be a 2nd class citizen in the new linqpad.
The string constructor workaround works, but it is not my favorite choice, because I do not want provider specific configuration calls/types in my DbContext.
Our configuration is usually setup in the composition-root/startup via DI, which is cleaner imho.
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.SQLite
Pomelo.EntityFrameworkCore.MySql
MySql.Data.EntityFrameworkCore
Oracle.EntityFrameworkCore
Npgsql.EntityFrameworkCore.PostgreSQL
But seems SQL Server not working correctly, full connection string is fixed to:
Data Source=h;Integrated Security=SSPI;app=LINQPad
, and cannot connect to my server.