TAINCER
DTDrizzle Team
•Created by TAINCER on 4/23/2024 in #help
Drizzle wants to truncate my tables when not needed
I have this schema:
I already have users in this table in production. Now I want to add a flag like this:
When I then run drizzle-kit push:sqlite (im using turso) it wants to truncate the table:
Am I missing something? To me this doesn't make sense.
2 replies
DTDrizzle Team
•Created by TAINCER on 4/21/2024 in #help
Use schema definition as normal types
I want to use my schema definition as a normal type. Basically what .select().from() returns - plain object with the type.
I need it for something like this:
const result = (await fetch("http://127.0.0.1:8000")).json() as Promise<typeof my_schema[]>;
I could of course define a type with the same schema as my db schema but then I have to update that whenever I update my schema, is there a better way?3 replies