MUG Knight
MUG Knight
DTDrizzle Team
Created by MUG Knight on 11/26/2024 in #help
Unable to create a check constraint for NaN values
I am working to prevent any chance of NaN from being inserted into my DB, so I created a check constraint that looks like the following: (table) => [ check("fancy_check_name", sql${table.amount} <> NaN), ], When I run drizzle-kit's push method, I get the following error, "error: column "nan" does not exist" Any combination of quotes or anything around NaN makes no difference.
Any Ideas?
5 replies
DTDrizzle Team
Created by MUG Knight on 10/7/2024 in #help
Adding record in Drizzle Studio with .generatedAlwaysAsIdentity error.
I have a table with a primary key column, defined as the following: id: bigint("id", { mode: "number" }) .primaryKey() .generatedAlwaysAsIdentity({ startWith: 1000 }), If I try to add an item into the table via Drizzle Studio, I get the following error: "cannot insert a non-DEFAULT value into column "id"" I can't find a combination of options/data entry to make this work. Any ideas?
2 replies