inhanbyeol
inhanbyeol
PPrisma
Created by inhanbyeol on 8/30/2024 in #help-and-questions
Typedsql Type?
-- @param {product_state} $1:state
SELECT * FROM product
WHERE 1 = 1
AND state = $1
-- @param {product_state} $1:state
SELECT * FROM product
WHERE 1 = 1
AND state = $1
const test = await this.prisma.$queryRawTyped(productFindList($Enums.ProductState.AVAILABLE));
console.log(test);
const test = await this.prisma.$queryRawTyped(productFindList($Enums.ProductState.AVAILABLE));
console.log(test);
PrismaClientKnownRequestError:
Invalid `prisma.$queryRawTyped()` invocation:


Raw query failed. Code: `42883`. Message: `ERROR: operator does not exist: product_state = text
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.`
at Ln.handleRequestError (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:7753)
at Ln.handleAndLogRequestError (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:7061)
at Ln.request (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:6745)
at l (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:130:9633)
at ProductRepository.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.repository.ts:69:22)
at ProductService.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.service.ts:60:37)
at ProductController.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.controller.ts:41:16)
PrismaClientKnownRequestError:
Invalid `prisma.$queryRawTyped()` invocation:


Raw query failed. Code: `42883`. Message: `ERROR: operator does not exist: product_state = text
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.`
at Ln.handleRequestError (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:7753)
at Ln.handleAndLogRequestError (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:7061)
at Ln.request (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:121:6745)
at l (/Users/inhanbyeol/Documents/Project/link-and-leave/node_modules/@prisma/client/runtime/library.js:130:9633)
at ProductRepository.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.repository.ts:69:22)
at ProductService.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.service.ts:60:37)
at ProductController.findList (/Users/inhanbyeol/Documents/Project/link-and-leave/src/product/product.controller.ts:41:16)
Can you guess why?
2 replies
PPrisma
Created by inhanbyeol on 6/26/2024 in #help-and-questions
Problems when deploying after a failed migration
I ran the test with the following example 1. assuming I have raw data, I created a field called test String and ran prisma migrate dev --name test --create-only. 2. when I ignored the warning and ran prisma migrate dev, a migration error occurred and a failed record was created in _prisma_migrations. 3. followed the official guide and ran deploy after rollback https://www.prisma.io/docs/orm/prisma-migrate/workflows/patching-and-hotfixing#option-1-mark-the-migration-as-rolled-back-and-re-deploy 4. reflected as normal 5. if you are working on additional migrations, we recommend a data wipe due to the following issue (The migration 20240626014409_test was modified after it was applied) Why?
2 replies
PPrisma
Created by inhanbyeol on 4/20/2024 in #help-and-questions
prisma migrate reset --force
Hi, I'm a prisma user. I am running prisma migrate reset --force to configure a test environment. However, even though I set the --force option, I am getting the following input window. Why? 'Are you sure you want to reset your database? All data will be lost.' (y/N)
1 replies