Mosch
Mosch
DTDrizzle Team
Created by Mosch on 8/12/2024 in #help
defaultFn when using magic sql is not applying
thanks for your help
14 replies
DTDrizzle Team
Created by Mosch on 8/12/2024 in #help
defaultFn when using magic sql is not applying
oh makes sense. So $defaultFn seems to be useless in that case
14 replies
DTDrizzle Team
Created by Mosch on 8/12/2024 in #help
defaultFn when using magic sql is not applying
That part of the drizzle schema is doing exactly this right? For other inserting ways its also working. Only Magic SQL seems to not work
id: text("id")
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
id: text("id")
.primaryKey()
.$defaultFn(() => crypto.randomUUID()),
14 replies
DTDrizzle Team
Created by Mosch on 8/12/2024 in #help
defaultFn when using magic sql is not applying
Its also working when using the normal query builder
14 replies
DTDrizzle Team
Created by Mosch on 8/12/2024 in #help
defaultFn when using magic sql is not applying
I am using postgres. The query:
sql`INSERT INTO "reminder" ("userId", "text", "dueDate") VALUES (${userId}, ${text}, ${dueDate})`;
sql`INSERT INTO "reminder" ("userId", "text", "dueDate") VALUES (${userId}, ${text}, ${dueDate})`;
fails because it violates the not null constraint of id. That why i think the default function isnt working when using magic sql
14 replies
TTCTheo's Typesafe Cult
Created by nikdav on 7/23/2023 in #questions
Website for local/generic barber
I think getting experience with next/t3 is the reason to use it here. Always do the same - build it half way - and then think: „that’s dumb. I am gonna use the better suited thing“ That though was during the time I only knew react tho. Next for sure isn’t a bad solution here - just overkill
15 replies
TTCTheo's Typesafe Cult
Created by nikdav on 7/23/2023 in #questions
Website for local/generic barber
For a purely static page i think Astro is worth to look at. For a Admin View you could use a Headless CMS
15 replies