Open Kaidstor opened 2 weeks ago
Getting this exact same problem, its started since drizzle-orm@0.32.0
Same thing here, seems like the typescript types are wonky all of a sudden. Same error, different schema:
// schema.ts
export const event = sqliteTable(
"Event",
{
id: text("id").primaryKey(),
projectId: integer("projectId")
.notNull()
.references(() => project.id),
type: text("type", { enum: ["EXCEPTION", "MESSAGE"] }).notNull(),
message: text("message"),
stack: text("stack", { mode: "json" }),
meta: text("meta", { mode: "json" }),
count: integer("count"),
createdAt: text("createdAt").default(sql`(CURRENT_TIMESTAMP)`),
lastEventAt: text("lastEventAt").default(sql`(CURRENT_TIMESTAMP)`),
resolvedAt: text("resolvedAt"),
},
(table) => {
return {
projectIdx: index("projectIdx").on(table.projectId),
};
}
);
import { db, schema } from "../../../../../db";
import { and, eq } from "drizzle-orm";
await db
.update(schema.event)
.set({ resolvedAt: new Date().toISOString() })
.where(
and(
eq(schema.event.id, String(eventId)),
eq(schema.event.projectId, Number(projectId))
)
);
Object literal may only specify known properties, and 'resolvedAt' does not exist in type '{ projectId?: number | SQL<unknown>; id?: string | SQL<unknown>; type?: SQL<unknown> | "EXCEPTION" | "MESSAGE"; }'.ts(2353)
in a different file, typescript errors over the count
column, and in another file, it errors over the id
column. Doesn't seem to matter what column or column type, just any column when trying to make an update using set
, or an insert using values
What version of
drizzle-orm
are you using?0.33.0
What version of
drizzle-kit
are you using?0.24.2
Describe the Bug
i have entity
but when try to update it
see the error: Object literal may only specify known properties, and 'active' does not exist in type '{ createdAt?: SQL | Date; country_code?: string | SQL; fromIp?: string | SQL; toIp?: string | SQL; }'.ts(2353)
Expected behavior
expect that I can to change boolean value and it contains in the
ranges
Environment & setup
No response