진양철
진양철
PPrisma
Created by 진양철 on 2/19/2025 in #help-and-questions
as type error
If no relationships are configured in the model, no type error occurs, but if a relationship model is defined in the model, a type error occurs
async create<T extends Prisma.TokenRecordCreateArgs>(args: T) {
return this.prisma.tokenRecord.create(args) as Promise<Prisma.TokenRecordGetPayload<T>>;
}
async create<T extends Prisma.TokenRecordCreateArgs>(args: T) {
return this.prisma.tokenRecord.create(args) as Promise<Prisma.TokenRecordGetPayload<T>>;
}
TS2352: Conversion of type
Prisma__TokenRecordClient<{ id: number; subject: 'NONE'; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }, never, DefaultArgs, PrismaClientOptions>
to type
Promise<GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>>
may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to unknown first.
Types of property then are incompatible.
Type '<TResult1 = { id: number; subject: "NONE"; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }, TResult2 = never>(onfulfilled?: ((value: { id: number; subject: "NONE"; ... 5 more ...; userId: number | null; }) => TResult1 | PromiseLike<...>) | null | und...' is not comparable to type '<TResult1 = GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>, TResult2 = never>(onfulfilled?: ((value: GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>) => TResult1 | PromiseLike<...>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => Promise...'.
Types of parameters onfulfilled and onfulfilled are incompatible.
Types of parameters value and value are incompatible.
Type
{ id: number; subject: 'NONE'; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }
is not comparable to type
GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>
TS2352: Conversion of type
Prisma__TokenRecordClient<{ id: number; subject: 'NONE'; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }, never, DefaultArgs, PrismaClientOptions>
to type
Promise<GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>>
may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to unknown first.
Types of property then are incompatible.
Type '<TResult1 = { id: number; subject: "NONE"; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }, TResult2 = never>(onfulfilled?: ((value: { id: number; subject: "NONE"; ... 5 more ...; userId: number | null; }) => TResult1 | PromiseLike<...>) | null | und...' is not comparable to type '<TResult1 = GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>, TResult2 = never>(onfulfilled?: ((value: GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>) => TResult1 | PromiseLike<...>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<...>) | ... 1 more ... | undefined) => Promise...'.
Types of parameters onfulfilled and onfulfilled are incompatible.
Types of parameters value and value are incompatible.
Type
{ id: number; subject: 'NONE'; accessToken: string; ip: string; isExpiration: boolean; createdAt: Date; updatedAt: Date; userId: number | null; }
is not comparable to type
GetFindResult<$TokenRecordPayload<DefaultArgs>, T, {}>
6 replies
PPrisma
Created by 진양철 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 진양철 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 진양철 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