feat(pls): add get_generators utility to retrieve generator blocks even when datasource is invalid#5649
Open
feat(pls): add get_generators utility to retrieve generator blocks even when datasource is invalid#5649
get_generators utility to retrieve generator blocks even when datasource is invalid#5649Conversation
…even when datasource is invalid
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new get_generators utility to @prisma/prisma-schema-wasm that can retrieve generator blocks from a Prisma schema even when the datasource block is invalid or malformed.
- Adds a new
parse_generatorsfunction that only parses generator blocks without validating the entire schema - Introduces a new
get_generatorsfunction to the WASM interface that wraps this functionality - Adds deprecation warnings for datasource attributes that will be moved to Prisma Config file in version 7.0.0
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| psl/psl/src/lib.rs | Exports the new parse_generators function |
| psl/psl-core/src/lib.rs | Implements the core parse_generators function |
| psl/psl-core/src/validate/datasource_loader.rs | Adds deprecation warnings for datasource attributes |
| psl/diagnostics/src/warning.rs | Adds warning message for datasource attributes moved to Prisma config |
| prisma-schema-wasm/src/lib.rs | Exposes get_generators function in WASM interface |
| prisma-fmt/src/lib.rs | Adds the new get_generators command with documentation |
| prisma-fmt/src/get_generators.rs | Implements the complete get_generators functionality with comprehensive tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Performance ReportMerging #5649 will not alter performanceComparing Summary
|
Contributor
WASM Query Engine File Size
WASM Query Compiler File Size
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR:
get_generatorsutility to@prisma/prisma-schema-wasm. It's basically a subset ofget_configthat doesn't fail when the datasource block is considered invalid