-
Notifications
You must be signed in to change notification settings - Fork 250
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
fix(psl): retrieve all referential actions based on relationMode #4844
Conversation
WASM Query Engine file Size
|
Somehow we didn't have a test for this in language-tools or in engines so I've added one here using the schema defined in the issue |
...ests/text_document_completion/scenarios/referential_actions_relation_mode_prisma/result.json
Outdated
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #4844 will not alter performanceComparing Summary
|
✅ WASM query-engine performance won't change substantially (0.997x)Full benchmark report
After changes in bd1a681 |
Test Results:
Which lines up with the following table from our Referential Actions Docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the change requests. Looks good!
…keys add new referential_actions fn that matches on relation_mode and defers to the FK / emulated actions
80843b2
to
bd1a681
Compare
The idea was to use
referential_actions
for retrieving the list of referential actions in the default SQL case (relationMode = "foreignKeys"
). Once MongoDB + PlanetScale support was required, we addedemulated_referential_actions
(only valid whenrelationMode = "prisma"
).We ran into an issue where we were only using
referential_actions
i.e. only for SQL FKs in prisma-fmt and therefore missing out on completions for referential actions specific torelationMode = "prisma"
, or in MongoDB's case, we didn't retrieve any.So this PR renames
referential_actions
intoforeign_key_referential_actions
and adds a newreferential_actions(&self, relation_mode: RelationMode) -> BitFlags<ReferentialAction>
method to help us avoid similar confusion in the futurefixes prisma/language-tools#1676
Context: Slack.