findmany doesn't easily allow gte or lte?

When looking at the typescript definition of the operators in the findmany where clause I see:
declare const operators: {
sql: typeof sql;
eq: typeof eq;
and: typeof and;
or: typeof or;
};
declare const operators: {
sql: typeof sql;
eq: typeof eq;
and: typeof and;
or: typeof or;
};
.findMany({
where: (table, operators) => (),
with: {
project: true
}
});
.findMany({
where: (table, operators) => (),
with: {
project: true
}
});
I expected to see lte/gte or even just gt, lt for the Postgrl neon configution. Is it expected that we use the raw sql operator? or is this unintentionally missing?
2 Replies
tunisoft
tunisoft2y ago
But in the docs, there's an example with lt
await db.query.posts.findMany({
where: (posts, { eq }) => (eq(posts.id, 1)),
with: {
comments: {
where: (comments, { lt }) => lt(comments.createdAt, new Date()),
},
},
});
await db.query.posts.findMany({
where: (posts, { eq }) => (eq(posts.id, 1)),
with: {
comments: {
where: (comments, { lt }) => lt(comments.createdAt, new Date()),
},
},
});
https://orm.drizzle.team/docs/rqb
mgarf
mgarfOP17mo ago
true but it causes typescript errors because its missing in the definition
Want results from more Discord servers?
Add your server