drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.68k stars 651 forks source link

[BUG]:drizzle-kit pull returns .with({"securityInvoker":"on"}) #3585

Open johnstonisaac99 opened 5 days ago

johnstonisaac99 commented 5 days ago

Report hasn't been filed before.

What version of drizzle-orm are you using?

0.36.3

What version of drizzle-kit are you using?

0.28.1

Other packages

No response

Describe the Bug

I have a pre-existing supabase database. I ran drizzle-kit pull which generated the drizzle folder including schema.ts

One of the schemas it generated looks like this

export const userInvites = pgView("user_invites", { status: text(),
    schoolName: text("school_name"),
}).with({"securityInvoker":"on"}).as(sql`SELECT i.status, s.school_name FROM invites i JOIN schools s ON i.school_id = s.id WHERE i.email_address = get_user_email()`);

The error says:

Type 'string' is not assignable to type 'boolean | undefined'.ts(2322)
view.d.ts(15, 5): The expected type comes from property 'securityInvoker' which is declared here on type 'ViewWithConfig'

I believe it should be .with({"securityInvoker":true})

Is it okay for me to just change those to true in the schema.ts? Is this a bug or did I do something wrong? Thanks I am using Supabase.