Fix prisma 7 support #30
Merged
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.
To fix prisma 7 support I thought about 2 approaches:
Just try to download all files that there could be, but don't fail if a file does not exist. The problem here is that filenames can change and we wouldn't notice if a file should be there but is not. Additionally, this would probably only work with then new API that just requires one hash.
Instead of only extracting the commit from lockfiles, we extract the full version string. Based on this we know which prisma version we have and know exactly which files to fetch. This makes it impossible to use nix-prisma-utils without providing at least the major version though, and thus removing support for the old "fromCommit" api. But I think there probably won't be anyone actually using this.
In this PR I implemented the second approach.
@aster-void What do you think?