Cannot use pgEnum with aws aurora

Hi. I can't seem to use pgEnum with the AWS aurora adapter, as i keep getting the same error over and over. It seems weird, as intellisense doesn't say that the types are wrong at all when i am doing the update query, but pg returns an error ERROR: column "status" is of type "EmailStatus" but expression is of type text; Hint: You will need to rewrite or cast the expression.; Position: 31; SQLState: 42804
await db
.update(email)
.set({ status: "sending", messageId: res.MessageId })
.where(eq(email.emailId, msg.emailId))

export const emailStatus = pgEnum("EmailStatus", [
"none",
"sending",
"sent",
"cancelled",
])
export const email = pgTable(
"email",
{
emailId: serial().primaryKey(),
status: emailStatus().default("none"),
},,
)
await db
.update(email)
.set({ status: "sending", messageId: res.MessageId })
.where(eq(email.emailId, msg.emailId))

export const emailStatus = pgEnum("EmailStatus", [
"none",
"sending",
"sent",
"cancelled",
])
export const email = pgTable(
"email",
{
emailId: serial().primaryKey(),
status: emailStatus().default("none"),
},,
)
2 Replies
neoney
neoney2mo ago
I am also getting this issue.
neoney
neoney2mo ago
GitHub
Bug Report: UUID Casting Issue in Drizzle KIT with PostgreSQL preve...
Bug Report: UUID Casting Issue in Drizzle Kit (Studio) with PostgreSQL Issue Description It seems the system is not casting correctly UUID fields as ::UUID, and that prevents update or deleting cre...
Want results from more Discord servers?
Add your server