oke
oke
DTDrizzle Team
Created by HoaxKey on 11/3/2024 in #help
Insert IF NOT EXISTS
Yes. You need your content column to have UNIQUE constraint Like this: content: text("content").unique().notNull()
6 replies
DTDrizzle Team
Created by HoaxKey on 11/3/2024 in #help
Insert IF NOT EXISTS
6 replies
DTDrizzle Team
Created by HoaxKey on 11/3/2024 in #help
Insert IF NOT EXISTS
Your content column needs to have a UNIQUE constraint
6 replies
DTDrizzle Team
Created by Ali on 11/3/2024 in #help
Depreciated table
Do you have the full error message?
10 replies
DTDrizzle Team
Created by Huijiro on 11/2/2024 in #help
Can I re-use my Prisma Migrations on Drizzle?
But back to OP, easiest way would be to just genenrate new migration files Drizzle Kit migration feature imo
6 replies
DTDrizzle Team
Created by Huijiro on 11/2/2024 in #help
Can I re-use my Prisma Migrations on Drizzle?
Yeah that's what I kinda dislike about Drizzle, not being to mark a migration as "should already happened", which makes "drizzle-kit push" entirely useless
6 replies
DTDrizzle Team
Created by Huijiro on 11/2/2024 in #help
Can I re-use my Prisma Migrations on Drizzle?
Drizzle does provide a way to write custom migration file, which you can then to generate empty migration files that you can then paste/copy/overwrite over https://orm.drizzle.team/docs/kit-custom-migrations, or just combine them all into one big migration file
6 replies
DTDrizzle Team
Created by Huijiro on 11/2/2024 in #help
Can I re-use my Prisma Migrations on Drizzle?
I think there is no automated way at the moment
6 replies
DTDrizzle Team
Created by dot on 10/30/2024 in #help
is there a way to use custom functions without raw sql?
I don't think you can. Drizzle ORM does not have knowledge of this function and wouldn't be able to infer types or give you a JavaScript-equivalent function for it. Custom sql is not that bad tbh
3 replies
DTDrizzle Team
Created by pikabo on 10/30/2024 in #help
Possible to infere type from PgEnum?
Maybe a more readable way is to define the array of values first, then pass that array into pgEnum
const severities = ["ok", "warning", "critical"] as const;
type Severity = typeof severities[number];
const severityPgEnum = pgEnum("severity", severities);
const severities = ["ok", "warning", "critical"] as const;
type Severity = typeof severities[number];
const severityPgEnum = pgEnum("severity", severities);
3 replies
DTDrizzle Team
Created by pikabo on 10/30/2024 in #help
Possible to infere type from PgEnum?
how about
type Severity = (typeof pgEnum.enumValues)[number]
type Severity = (typeof pgEnum.enumValues)[number]
3 replies