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?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server