DT
Drizzle TeamSuji
Infer return type for relational query with pagination
I have created a function that can paginate data for relational queries, problem is i cant figure out how to make to include the relations that are passed into the inferred return type
returnType is typed with only the base table fields, this doenst include the fields that get included from relations. Any clues or pointers ??
A
Amur•309d ago
@therealsujje did you manage to solve this?
S
Suji•309d ago
Nope
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
7.3KMembers
View on DiscordWant results from more Discord servers?
More PostsHow to implement triggers or db hooks ?Is there a way to know if sql statement got executed successfully or not ? I wanted to run a code whnoob help: INSERT with JOIN SQL to DrizzleFrontend developer dabbling with SQL for the first time in years. With the help of ChatGPT I have thOrderBy with dynamic queries dont work```
....orderBy(sql`${products.xyz} ${order}`)
```
```
error: syntax error at or near "$2"
```
ordeIs there a way to limit update to just 1 document?I know there will be multiple documents matching this where query, but I only want to update 1 of thHow to get InferModel to work with Relation model?Is there a way to get the infer type for a relation model? eg:
type User = InferModel<typeof users,MySQL column type: "Generated"?Does drizzle support defining generated columns? https://planetscale.com/courses/mysql-for-develope