Comments (6)
For now we can probably solve this issue by catching error below.
Raw query failed. Code:
55000
. Message: `db error: ERROR: cannot delete from view
from redwood.
Thanks @majimaccho for the issue, and ofcourse the analysis behind it - much appreciated!
I would say let's wait to hear back from the Prisma team as views are still a preview feature, before we implement anything.
@cannikin - could I hand this over to you to track?
from redwood.
Hello! So your only concern at this point is the failing tests? Did you want to try and come up with a PR that addresses it? Until Prisma adds something to getDMMF()
you could catch that error here: https://github.com/redwoodjs/redwood/blob/main/packages/testing/config/jest/api/jest.setup.js#L141-L156
You can see that we already expect some errors for foreign key relationships, you could add another catch block for the error you identified above.
from redwood.
@cannikin @dac09 Thank you for your kind and quick feedback.
Yeah, I already checked the jest.config.js
and some error codes are catched and pushed to stack.
Of cause I can add something to catch the error.
However, the error code I got was below.
Raw query failed. Code: `55000`. Message: `db error: ERROR: cannot delete from view "pro_answer_all_values_view"
DETAIL: Views that do not select from a single table or view are not automatically updatable.
HINT: To enable deleting from the view, provide an INSTEAD OF DELETE trigger or an unconditional ON DELETE DO INSTEAD rule.`
According to PostgreSQL's documentation The error code 55000
is object_not_in_prerequisite_state
and not specifically for the error deleting views.
So the easiest way to handle this issue is that I just add scripts to check if the entire error message starts with Raw query failed. Code:
55000. Message:
db error: ERROR: cannot delete from view `.
It's just works on PostgreSQL but maybe not on MySQL or others.
from redwood.
Any solution we come up with will need to work with MySQL and SQLite as well...did you want to try applying your same schema to those two databases as well, running the tests, and adding those errors to the catch
?
from redwood.
@cannikin
Yeah, I can take it if you give me some time (like in this year).
But for short term, I escaped from this problem by using INSTEAD OF DELETE
trigger.
from redwood.
Related Issues (20)
- [Auth] Common AuthProvider & use* changes for middleware auth HOT 1
- [OG] Finish OG Image generation with updated middleware implementation HOT 1
- [Auth] Implement dbAuth middleware
- [Auth] createMiddlewareAuth (web side) for dbAuth
- [Auth] Implement POST handlers for login, signup, etc. on dbAuth
- [Bug?]: dbAuth `userAttributes` comment error HOT 7
- [Bug?]: Uploading files through custom functions doesn't work HOT 1
- [Bug?]: Updating from 7.3.0 to 7.4.1 will fail, if there is no npx available HOT 4
- [Bug?]: console prints wrong GraphQL endpoint when apiGraphQLUrl is set in dev enviornment HOT 4
- [Bug?]: client-build-manifest.json needs an import assertion of type "json" when using RSC HOT 6
- [Bug?]: Cannot wrap components in RedwoodApolloProvider in jest tests HOT 7
- [Bug?]: ERROR Function "" was not found. HOT 8
- [Bug?]: HydrateRoot and TypeError: Cannot read properties of undefined ... at Object.prerenderLoader on whichever page first loads HOT 5
- [Bug?]: Seeing 500s due to ERR_STREAM_PREMATURE_CLOSE after upgrade to 7.x HOT 4
- [Bug?]: fastify compress plugin not working as per docs HOT 3
- [Bug?]: nftPack: undefined is not a function HOT 9
- [Bug?]: Authentication Error After Upgrading from Version 6.6.4 to 7.4.3 HOT 4
- [Docs]: useCache!!! HOT 1
- [Bug?]: Setting --verbose when deploying to baremetal "fails" during cleanup step. SshExecutor.js does not check that "args" is defined. HOT 6
- [Bug?]: yarn rw setup auth supabase not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redwood.