-
Notifications
You must be signed in to change notification settings - Fork 62
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
Proposed refactor of MigrationServiceFactory #124
base: master
Are you sure you want to change the base?
Proposed refactor of MigrationServiceFactory #124
Conversation
…pendency injection back to Core
Hi @Jabestrada , thanks again for continuous feedback and apologies for delayed response. I as much would like to make sure I spent decent time to craft my response. In the beginning, I aimed for dynamic loading of platform assemblies thus the presence of I still have an opened case here https://stackoverflow.com/questions/59463164/failed-to-load-plugin-dependency-using-assemblyloadcontext-in-net-core-3-0 on this issue. With respect to supporting SQL Lite, I discussed this with another contributor on different subject where what if we would like to support NoSqlDB. This is a valid point and I think one approach is to create another A more drastic approach is to put all the responsibility into the platform implementation. Such that |
Cool. I hope you won't mind if I spend some time figuring out how to make AssemblyLoadContext work for this particular scenario instead of working straight on SQLite support. Perhaps I'll get lucky and stumble on to something. |
@Jabestrada oh that would be both fun and very challenging to do, so sure feel free to pick on it! Try to test dynamic loading of the plugins Yuniql.SqlServer and Yuniql.PostgreSql at least. We have intial implementation here: And this is largely inspired by these: Nate seems to have solved this well here Though I think this issue has got higher priority and value over implementing dynamic plugins. Br, Rodel |
Thanks for the links. I'll just give it a few hours and see how far I can go. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Hi @rdagumampan , I've updated MigrationServiceFactory to use AssemblyLoadContext. High-level notes on the changes:
Some caveats/limitations:
I guess the update of the .deps.json file happens automatically when the platform-specific projects are installed to the CLI using Nuget but I haven't gotten that far.
Try cloning my branch and give it a try, and let me know what you think. |
Hi @Jabestrada , thanks again and I will look into it this week. I'm just bit occupied in preparing for release of /ardi |
Hi @rdagumampan,
This PR is not intended to be merged as-is (for starters, the unit tests won't build) but rather just a starting point for a discussion on a proposed refactor of the MigrationServiceFactory implementation.
As I was analyzing how to add support for SQLite, it occurred to me that SQLite would need a different IConfigurationDataService implementation since it's a file-based database rather than a server-based one. For instance, checking for database existence and creating the database are file-check and file-create operations respectively (instead of executing SQL queries).
Creating the SQLite-specific IConfigurationDataService is trivial but it's the MigrationServiceFactory implementation that's proving to be a challenge for the following reasons:
Here are the key points in this PR that aim to address the challenges above:
Hope I explained things clearly; let me know what you think.