KyselyK
Kysely3y ago
4 replies
mike

Zero number omitted from parameters

I looks like the compile() works incorrectly with zero number when used as parameter - the parameter is omitted from the array of sql components.

Not included in sql params:
// used in case/when
.when(eb.fn.max('Orders.quantity'), '>', 0)

// used in case/then/else
.else(0)


Included (workaround) in the params:
.when(eb.fn.max('Orders.quantity'), '>', sql<number>`0`)
.else(sql<number>`0`)
Was this page helpful?