Berzerker
Berzerker
DTDrizzle Team
Created by Berzerker on 10/1/2023 in #help
Does anyone have an idea why the column definition is wrapping the dataType with " ... "
This is making the whole SQL expression invalid. If I remove manually the " .. " around the expression it works. This is the result of running drizzle-kit generate:pg https://github.com/drizzle-team/drizzle-orm/issues/247#issuecomment-1742110943
4 replies
DTDrizzle Team
Created by Berzerker on 10/1/2023 in #help
How do I create a generated and stored column with drizzle-orm? Target db is Postgres
Hello 👋 , can someone point me to how I should go about creating a generated column for a table that is defiend using drizzle? Database is Postgres if that matters.
3 replies
DTDrizzle Team
Created by Berzerker on 9/29/2023 in #help
How do I extract a shared "Schema" that is used across several tables?
I want to have a construct like this:
export const auditAware: ????? = {
createdAt: date('created_at').notNull(),
updatedAt: date('updated_at').notNull(),
updatedBy: text('updated_by').notNull().references(() => user.id),
};
export const auditAware: ????? = {
createdAt: date('created_at').notNull(),
updatedAt: date('updated_at').notNull(),
updatedBy: text('updated_by').notNull().references(() => user.id),
};
Then just spread the props unto the tables. The question is how do I spread the ????? bit.
4 replies