willy_24
How to make general purpose queries?
Hello everyone.
I am currently developing a medium-scale server using express and Kysely as a query builder (which I have adored so far).
However, with the growing codebase, I've noticed that many select, update and insert queries are similar between them.
That being said, it would be very useful to have a wrapper to perform those similar queries, which I've tried to build like so:
The problem here is that Kysely doesn't directly expose
ReferenceExpression<DB, ExtractTableAlias<DB, TB>>
, which is the required type from the where()
method.
Then I also have a problem with the filterBy
param, which at the moment always accepts Generated<number> | number | null | Generated<Date> | Date | string | [Generated<number> | number | null | Generated<Date> | Date | string]
.
Any help would be very helpful!8 replies