tzezar
Explore posts from serversDTDrizzle Team
•Created by Suryansh on 8/7/2024 in #help
Extending Typescript Client Model(Table)
I will give you example, sorry for formatting i am writing from phone
oop way:
fp way:
8 replies
DTDrizzle Team
•Created by Suryansh on 8/7/2024 in #help
Extending Typescript Client Model(Table)
Second one: use concat and select builder or query builder with https://orm.drizzle.team/docs/rqb#include-custom-fields
8 replies
DTDrizzle Team
•Created by Suryansh on 8/7/2024 in #help
Extending Typescript Client Model(Table)
First scenario: you either create class instance with described method and map results to it - each entry will have this method, I dont recommend creating classes in TS tho, but if this is helpfull for you then why not. Or: create function that takes results array / entry object and pass results to it constructing desired shape of data.
8 replies
DTDrizzle Team
•Created by Suryansh on 8/7/2024 in #help
Extending Typescript Client Model(Table)
Do you want to have function attached to result that will return fullName or you want to return fullName constructed in db?
8 replies
DTDrizzle Team
•Created by jrydberg on 8/3/2024 in #help
How to get the type of transaction from a database?
I did it like this: it allows to pass regular db conn or transaction
6 replies
DTDrizzle Team
•Created by jrydberg on 8/3/2024 in #help
How to get the type of transaction from a database?
import { type PostgresJsDatabase } from "drizzle-orm/postgres-js";
6 replies
DTDrizzle Team
•Created by Liam on 7/31/2024 in #help
There is not enough information to infer relation
I am not sure since i have not used drizzle for so long. Is your relations syntax correct? As i remember i had to set references field
5 replies