-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use Prisma's programmatic API in keystone-next reset and make keystone-next reset actually work #5152
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/67D6WdMJ77Ri6Rj7CbjDNnY7VF9D |
🦋 Changeset detectedLatest commit: 9651eff The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9651eff:
|
); | ||
for (const { name } of tables) { | ||
await this.prisma.$queryRaw(`DELETE FROM "${name}";`); | ||
throw new Error('Only "postgresql" and "sqlite" providers are supported'); |
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.
Given we need to have a case for all the providers we'll want to support to run the tests fast enough, having a general case that we never actually use or test seems silly so I changed to an error.
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.
Oh, nice catch, this was causing our sqlite tests to be way slower than they needed to be on CI!
Co-authored-by: Tim Leslie <[email protected]>
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.
Looks good 👍
Same as #5148 but for reset. This also makes the reset command actually runnable, it wasn't in the cli file before.