KyselyK
Kysely2y ago
Ross

Argument of type 'RawBuilder<unknown>' is not assignable to...

I have a query that looks like this:

countQuery.where(
'activityId',
'in',
sql(SELECT activityId FROM activities WHERE MATCH(EL_EQ_PRODUCT_DESCRIPTION) AGAINST (+"${value}" IN BOOLEAN MODE)),
);

TypeScript is now showing an error that states:

Argument of type 'RawBuilder<unknown>' is not assignable to parameter of type 'OperandValueExpressionOrList<Database, "activities", "activityId">'.

This is with Kysely 0.27.0/0.27.1/0.27.2 and TypeScript 5.3.3

Can anyone explain what's going on here please?
Solution
What you actually want is something like this

sql<string>`(SELECT activityId FROM activities WHERE MATCH(EL_EQ_PRODUCT_DESCRIPTION) AGAINST (${'+' + value} IN BOOLEAN MODE))`
Was this page helpful?