import { InjectKysely } from 'nestjs-kysely';
import { DB } from 'kysely-codegen';
import { Kysely } from 'kysely';
// Declare the statement in the constructor of the service folder
@InjectKysely() private readonly kdb: Kysely<DB>;
async updateProfileScore(score: number, userId: string) {
try {
await this.kdb.updateTable('resume.userDetails')
.set({ profileScore: score })
.where('resume.userDetails.user', '=', userId)
.execute();
return true;
} catch (e) {
this.logger.error(e, 'Profile score update error');
return false;
}
}
I am using NestJS and have integrated Kysely into my project. Everything is working fine in development, but when I push this code to the stage environment, I encounter the following error:
Overload 1 of 3, '(table: never): UpdateQueryBuilder<DB, never, never, UpdateResult>', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'never'.
Overload 2 of 3, '(table: never): UpdateQueryBuilder<never, never, never, UpdateResult>', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'never'.
Overload 3 of 3, '(table: AliasedExpression<any, any>): UpdateQueryBuilder<{ [x: string]: never; }, any, any, UpdateResult>', gave the following error.
Argument of type 'string' is not assignable to parameter of type 'AliasedExpression<any, any>'.
I am expecting some hint so that I can integrate it successfully.
I am using NestJS and have integrated Kysely into my project. Everything is working fine in development, but when I push this code to the stage environment, I encounter the error.