Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork404
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
License
PomeloFoundation/Pomelo.EntityFrameworkCore.MySql
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Pomelo.EntityFrameworkCore.MySql is the most popular Entity Framework Core provider for MySQL compatible databases. It supports EF Core up to its latest version and usesMySqlConnector for high-performance database server communication.
The following versions of MySqlConnector, EF Core, .NET (Core), .NET Standard and .NET Framework are compatible with published releases ofPomelo.EntityFrameworkCore.MySql:
| Release | Branch | MySqlConnector | EF Core | .NET (Core) | .NET Standard | .NET Framework |
|---|---|---|---|---|---|---|
| 9.0.0 | main | >= 2.4.0 | 9.0.x | 8.0+ | - | - |
| 8.0.3 | 8.0-maint | >= 2.3.5 | 8.0.x | 8.0+ | - | - |
| 7.0.0 | 7.0-maint | >= 2.2.5 | 7.0.x | 6.0+ | - | - |
| 6.0.3 | 6.0-maint | >= 2.1.2 | 6.0.x | 6.0+ | - | - |
| 5.0.4 | 5.0-maint | >= 1.3.13 | 5.0.x | 3.0+ | 2.1 | - |
| 3.2.7 | 3.2-maint | >= 0.69.10 < 1.0.0 | 3.1.x | 2.0+ | 2.0 | 4.6.1+ |
- Pomelo.EntityFrameworkCore.MySql
- Pomelo.EntityFrameworkCore.MySql.Json.Microsoft
- Pomelo.EntityFrameworkCore.MySql.Json.Newtonsoft
- Pomelo.EntityFrameworkCore.MySql.NetTopologySuite
Pomelo.EntityFrameworkCore.MySql is tested against all actively maintained versions ofMySQL andMariaDB. Older versions (e.g. MySQL 5.7) and other server implementations (e.g. Amazon Aurora) are usually compatible to a high degree as well, but are not tested as part of our CI. You can find a list of the versions, a release was tested against, within itsrelease notes.
Currently tested versions are:
- MySQL 8.4
- MySQL 8.0
- MariaDB 11.6
- MariaDB 11.5
- MariaDB 11.4 (LTS)
- MariaDB 11.3
- MariaDB 10.11 (LTS)
- MariaDB 10.6 (LTS)
- MariaDB 10.5 (LTS)
| Milestone | Status | Release Date |
|---|---|---|
| 9.0.0 | Released | 2025-08-17 |
| 8.0.3 | Released | 2025-03-02 |
| 7.0.0 | Released | 2023-01-16 |
| 6.0.3 | Released | 2024-03-16 |
| 5.0.4 | Released | 2022-01-22 |
| 3.2.7 | Released | 2021-10-04 |
To use nightly builds from our Azure DevOps feed, add aNuGet.config file to your solution root with the following content and enableprereleases:
<?xml version="1.0" encoding="utf-8"?><configuration> <packageSources> <addkey="pomelo-nightly"value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" /> <addkey="nuget.org"value="https://api.nuget.org/v3/index.json" /> </packageSources></configuration>
Feeds that contain optimized (Release configuration) builds:
https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.jsonhttps://www.myget.org/F/pomelo/api/v3/index.json
Feeds that contain debugging enabled unoptimized (Debug configuration) builds:
https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.jsonhttps://www.myget.org/F/pomelo-debug/api/v3/index.json
The AZDOnupkg packages always contain.pdb files.
The MyGetnupkg packages only contain.pdb files for their debug builds. For optimized builds, the symbols are packed in asnupkg file and are available via thehttps://www.myget.org/F/pomelo/api/v2/symbolpackage/ symbol server URL.
All.pdb files use Source Link.
Ensure that your.csproj file contains the following reference:
<PackageReferenceInclude="Pomelo.EntityFrameworkCore.MySql"Version="9.0.0" />
AddPomelo.EntityFrameworkCore.MySql to the services configuration in yourStartup.cs file of your ASP.NET Core project:
publicclassStartup{publicvoidConfigureServices(IServiceCollectionservices){// Replace with your connection string.varconnectionString="server=localhost;user=root;password=1234;database=ef";// Replace with your server version and type.// Use 'MariaDbServerVersion' for MariaDB.// Alternatively, use 'ServerVersion.AutoDetect(connectionString)'.// For common usages, see pull request #1233.varserverVersion=newMySqlServerVersion(newVersion(8,4,6));// Replace 'YourDbContext' with the name of your own DbContext derived class.services.AddDbContext<YourDbContext>( dbContextOptions=>dbContextOptions.UseMySql(connectionString,serverVersion)// The following three options help with debugging, but should// be changed or removed for production..LogTo(Console.WriteLine,LogLevel.Information).EnableSensitiveDataLogging().EnableDetailedErrors());}}
View ourConfiguration Options Wiki Page for a list of common options.
Check out ourIntegration Tests for an example repository that includes an ASP.NET Core MVC Application.
There are also many complete and concise console application samples posted in the issue section (some of them can be found by searching forProgram.cs).
Refer to Microsoft'sEF Core Documentation for detailed instructions and examples on using EF Core.
Use theEF Core tools to execute scaffolding commands:
dotnet ef dbcontext scaffold "Server=localhost;User=root;Password=1234;Database=ef" "Pomelo.EntityFrameworkCore.MySql"One of the easiest ways to contribute is to report issues, participate in discussions and update the wiki docs. You can also contribute by submitting pull requests with code changes and supporting tests.
We are always looking for additional core contributors. If you got a couple of hours a week and know your way around EF Core and MySQL, give us a nudge.
About
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.