oof2win2
oof2win2
Explore posts from servers
DTDrizzle Team
Created by oof2win2 on 10/9/2024 in #help
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"),
},,
)
3 replies
DTDrizzle Team
Created by oof2win2 on 8/20/2024 in #help
Joins with the Query API
Hi. I want to use .query to have nested queries for subitems, but i would also like to execute table joins within the API. Is it possible to achieve this somehow?
1 replies
DTDrizzle Team
Created by oof2win2 on 8/18/2024 in #help
drizzle-kit libsql extensions
hi. i want to ask if it is possible to add the extensions to drizzle-kit's libsql, mainly altering existing columns on tables. the issue is that drizzle-kit generates a migration with a generic message, where it doesn't specify which columns have changed so i can't even alter the columns myself. is there a way to add in an implementation of altering columns so that drizzle can use it, or at least getting drizzle to log the change that should be performed so that i can write the query myself?
/*
SQLite does not support "Creating foreign key on existing column" out of the box, we do not generate automatic migration for that, so it has to be done manually
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
https://www.sqlite.org/lang_altertable.html

Due to that we don't generate migration automatically and it has to be done manually
*/--> statement-breakpoint
/*
SQLite does not support "Creating foreign key on existing column" out of the box, we do not generate automatic migration for that, so it has to be done manually
Please refer to: https://www.techonthenet.com/sqlite/tables/alter_table.php
https://www.sqlite.org/lang_altertable.html

Due to that we don't generate migration automatically and it has to be done manually
*/--> statement-breakpoint
1 replies