TS2345: Argument of type "id" is not assignable to parameter of type ReferenceExpression<Database
Code:
Schema File:
TokenType Enum (incase it matters):
The code is giving me a typescript error for the first argument of the where clause, "id":
Solution:Jump to solution
So all in all
```ts
import { ColumnType, Generated, Selectable } from "kysely";
import { TokenType } from "./lib/token";...
5 Replies
I also tried "tokens.id", same ts error :(
Hey 👋
You used
TokenType
instead of TokenTable
in Database
.Also
id
uses Number
instead of number
.
That's the "class" version of number that should never be used as a type
Also insertId
is a bigint. You need to cast it to a normal numberSolution
So all in all
Thanks, that fixed everything :)