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
23.84k stars 592 forks source link

[BUG]:Property 'notNull` in the timstamp type #1535

Open lawplatform opened 11 months ago

lawplatform commented 11 months ago

What version of drizzle-orm are you using?

0.29.0

What version of drizzle-kit are you using?

0.20.4

Describe the Bug

export const real = pgTable("real", {
    // You can use { mode: "bigint" } if numbers are exceeding js number limitations
    id: bigint("id", { mode: "number" }).primaryKey().notNull(),
    createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).default((now() AT TIME ZONE 'Asia/Seoul':: text)).notNull(),
    name: text("name"),
        msg: text("msg"),
});

after drizzle kit pull from the supabase schema I got error message notNull() does not exist on type 'PGTableWithColumns'

but I found it is ok createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),

so I guess it is some syntax problem while constraint of timestamp value even I never touched, but I don't know how to touched

name , and msg below the createdAt also affected and throw error Left side of comma operator is unsued and has no side effect

Expected behavior

after drizzle-kit push every thing is ok

Environment & setup

i got data from the supabase

lawplatform commented 11 months ago

I realize this table is real time checked table does it matter? should I seperate other schema when I table set as realtime ?