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?2 Replies