Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating provider to 3.0 #18900

Closed
cincuranet opened this issue Nov 14, 2019 · 7 comments
Closed

Migrating provider to 3.0 #18900

cincuranet opened this issue Nov 14, 2019 · 7 comments
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@cincuranet
Copy link
Contributor

Is there any "document" describing all the changes when migrating provider from 2.2 to 3.0/3.1? I found #15405, but that's more or less only list of providers-beware tag for 3.0. What I'm mostly interested it changes in query processing and model handling, because that's where most of compilation errors happens for me at the moment.

@ajcvickers
Copy link
Member

@cincuranet Unfortunately no. The team will try to provide help wherever we can. Also @roji and @lauxjpn have done this for Npgsql and MySQL and so may be able to help.

@roji
Copy link
Member

roji commented Nov 14, 2019

@cincuranet anything in particular you're blocking on? I'd be happy to provide any assistance etc.

@cincuranet
Copy link
Contributor Author

cincuranet commented Nov 15, 2019

At the moment I'm trying to make it build, at least. Fair to say I blindly updated the references to 3.1 in the name of to see what's what. :D I'm looking into EFCore sources and commits in Npgsql to speed things up. If you can give me some pointers, it would be appreciated (I'll keep working on that myself, so whatever comes first is a win 8-)).

  • Where's RelationalModelBuilderAnnotations, RelationalPropertyAnnotations and similar types?
  • Replacements for RelationalCompositeMemberTranslator, RelationalCompositeMethodCallTranslator, DefaultQuerySqlGenerator, etc.?
  • RelationalConventionSetBuilder and related?

@ajcvickers
Copy link
Member

@lauxjpn
Copy link
Contributor

lauxjpn commented Nov 15, 2019

@cincuranet As a general guideline, you can dive into our PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#822 PR, which contains most of the conversion work done for the MySQL provider for the upgrade from 2.2.6 to 3.0.0, and consists of 79 individual commits with each of them containing a short description of what has been done.
It will also provide a general overview of what files were removed and added.

To migrate something specific, here is what I usually did (when only using GitHub as a tool):

  • Open @roji's https://github.com/npgsql/efcore.pg repository and change the branch to hotfix/2.2.6 and click on Find file.
  • Open another tab to the repository, but stay on the dev branch (the default).
  • Use the 2.2.6 tab to look for the corresponding file you want to migrate. E.g. if I want to migrate MySqlQuerySqlGenerator, I would search for NpgsqlQuerySqlGenerator on the 2.2.6 tab to find the old file. I would then do the same on the dev tab and then either do an actual diff, or would just use the dev tab as a reference.
  • In case I wouldn't find the corresponding file on the dev tab, I would use the general GitHub search function Search or jump to... on the dev tab (this search will only look through the default branch) to search (using in this repository) for something unambiguous from the 2.2.6 file (e.g. a typeof() that would only make sense there) to find the corresponding file or implementation for 3.0.0.
  • Doing this locally with a strong search tool might be more powerful.

Generally speaking, you can assume that most things you used in 2.2.6 will have an equivalent in 3.0.0. So having a local clone of the EF Core repo and the Npgsql repo, both at the same time as the 2.2.6 and 3.0.0 version, will be handy.

Make sure to reference the local EF Core repo's assemblies for development instead of the Nuget packages, so you can directly navigate through the actual EF Core source code (especially when using Resharper) from inside your own VS solution.

@ajcvickers ajcvickers added this to the Discussions milestone Nov 15, 2019
@ajcvickers ajcvickers changed the title OT: Migrating provider to 3.0 Migrating provider to 3.0 Nov 15, 2019
@cincuranet
Copy link
Contributor Author

@lauxjpn That's in general what I do. But sometimes the code does not explain the reasoning behind and it's difficult to make a right decision if you don't know all the places that fit together especially as the code does not compile yet (at the moment trying to understand ApplyTypeMapping).

@lauxjpn
Copy link
Contributor

lauxjpn commented Nov 19, 2019

@cincuranet I had similar problems when starting with the migration. I just mirrored what Npgsql or Sqlite did and left bookmarks behind when I was unsure about decisions I made on the spot, to which I came back to after I got everything to compile and thus the tests to run again.

@ajcvickers ajcvickers added closed-no-further-action The issue is closed and no further action is planned. and removed type-enhancement labels Dec 7, 2019
@ajcvickers ajcvickers removed this from the Discussions milestone Dec 7, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

4 participants