TypeError saying `id` doesn't exist in table?

I created a user table that gets some data from Clerk inserted or updated accordingly. However, when doing
await db.insert(usersTable).values({
id: data.id,
firstName: data.first_name,
lastName: data.last_name,
})
await db.insert(usersTable).values({
id: data.id,
firstName: data.first_name,
lastName: data.last_name,
})
It gives a type error of
No overload matches this call.
Overload 2 of 2, '(values: { id: string | SQL<unknown> | Placeholder<string, any>; firstName: string | SQL<unknown> | Placeholder<string, any>; lastName: string | SQL<unknown> | Placeholder<...>; organization?: string | ... 3 more ... | undefined; }[]): PgInsertBase<...>', gave the following error.
Object literal may only specify known properties, and 'id' does not exist in type '{ id: string | SQL<unknown> | Placeholder<string, any>; firstName: string | SQL<unknown> | Placeholder<string, any>; lastName: string | SQL<unknown> | Placeholder<...>; organization?: string | ... 3 more ... | undefined; }[]'
No overload matches this call.
Overload 2 of 2, '(values: { id: string | SQL<unknown> | Placeholder<string, any>; firstName: string | SQL<unknown> | Placeholder<string, any>; lastName: string | SQL<unknown> | Placeholder<...>; organization?: string | ... 3 more ... | undefined; }[]): PgInsertBase<...>', gave the following error.
Object literal may only specify known properties, and 'id' does not exist in type '{ id: string | SQL<unknown> | Placeholder<string, any>; firstName: string | SQL<unknown> | Placeholder<string, any>; lastName: string | SQL<unknown> | Placeholder<...>; organization?: string | ... 3 more ... | undefined; }[]'
from what I can gather it's saying that id does not exist on the table?
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server