Make sea-orm-cli & sea-orm-migration dependencies optional #2367
+268
−104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #2320.
My team is working on a workspace project. To make sure generated models are always the same, we decided to make
sea-orm-cli
a member crate. You may find details at the discussion 1889.The problem is,
sea-orm-cli/codegen
feature imports all the database drivers, even thoughsqlite
andmysql
represent zero interest for me.libsqlite-sys
+sqlx-mysql
+sqlx-sqlite
take quite a few seconds in total compilation time, and I believe this could be improved.I've gone through
dependency-hellfeature-shenanigans, but could easily make a mistake. So testing and merging this PR won't be easy. I tested the code on my local environment: tweaked all the possible combinations of features to see, whether the compiler would grumble. Also, I have patched my team project with local sea-orm codebase and tested it against it.