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
feat(fmt): add quick-fix for missing indexes when relationMode = "prisma" #3431
Conversation
Added quickfix to add indexes for relations when RelationMode=Prisma fixes #1297 Co-authored-by: Tom tom@tomhoule.com
waiting on #3429 |
…e end of a block Updated: `create_missing_unique` ~> `create_missing_attribute` + `create_block_attribute`
prisma-fmt/tests/code_actions/scenarios/relation_mode_prisma_missing_index/result.json
Outdated
Show resolved
Hide resolved
ok
|
…relation_mode-indexes
…n; also updated schema.prisma to be mysql relationmode
prisma-fmt/tests/code_actions/scenarios/relation_mode_prisma_missing_index/diagnostics.json
Outdated
Show resolved
Hide resolved
Let's merge #3447 then rebase this |
} | ||
}, | ||
"severity": 1, | ||
"message": "With `relationMode = \"prisma\"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to poor performance when querying these fields. We recommend adding an index manually. Learn more at https://pris.ly/d/relation-mode#indexes" |
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.
I think the message was updated in the meantime, but as this is just input and expectation at the same time (And does not use the actual correct warning), this should be fine.
(Or should this actually be wired up to the real warning?)
Let's merge this (checked with Soph on Slack) |
Added quickfix to add indexes for relations when RelationMode=Prisma
-- where
@@index
did not existcloses #1297