Filter on included relations

Hello! Hope you're all doing well! Is it possible to filter based on included relations?
return await this.db.query.myTable.findMany({
with: {
relations: true,
},
where: (doc, { and, eq, inArray }) => {
const predicates: SQL[] = [];
predicates.push(
eq(schema.relationTable.type, "my-type"),
);
predicates.push(
eq(schema.relationTable.value, value.toString()),
);

return predicates.length > 0 ? and(...predicates) : undefined;
},
});
return await this.db.query.myTable.findMany({
with: {
relations: true,
},
where: (doc, { and, eq, inArray }) => {
const predicates: SQL[] = [];
predicates.push(
eq(schema.relationTable.type, "my-type"),
);
predicates.push(
eq(schema.relationTable.value, value.toString()),
);

return predicates.length > 0 ? and(...predicates) : undefined;
},
});
3 Replies
Mario564
Mario5643d ago
This is currently not possible. We're working on making this a feature in RQB v2
Julian
Julianthis hour
@Mario564 Just wondering, is there any rough timeline RQBv2? Thanks!
Mario564
Mario56414h ago
Should be released between this month and the next, exact date TBD
Want results from more Discord servers?
Add your server