K
Join ServerKysely
help
Property does not exist on type
Hello.
I'm trying to run the following query:
but I'm getting the following error:
Any help appreciated.
I'm trying to run the following query:
result = await db.selectFrom("data")
.select(['partner_cd','reporter_cd'])
.where(({ cmpr, or, and, not, exists, selectFrom, val }) => or([
and([
cmpr('reporter_cd', '=', country),
cmpr('country_cd', '=', partner)
]),
and([
cmpr('country_cd', '=', country),
cmpr('reporter_cd', '=', partner)
]),
]))
.execute();
but I'm getting the following error:
Property 'cmpr' does not exist on type 'WhereInterface<From<DB, "data">, "data">'
Any help appreciated.
Solution
Message Not Public
Sign In & Join Server To View
Hello
Yes it's verion 0.23
Message Not Public
Sign In & Join Server To View
Ok will do
BTW how could I implement this expression without this new expression builder stuff
?
kysely
.selectFrom("data")
.where((wb) =>
wb.where("reporter_cd", "=", country).where("country_cd", "=", partner),
)
.orWhere((wb) =>
wb.where("country_cd", "=", country).where("reporter_cd", "=", partner),
)
.select(["partner_cd", "reporter_cd"])
.execute()
https://kyse.link/?p=s&i=y4MGy7uooZhq3NKtW7o9
Thanks so much
That works great