K
Kysely14mo ago
kewp

Property does not exist on type

Hello. 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();
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">'
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
Jump to solution
7 Replies
Solution
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
kewp
kewp14mo ago
Hello Yes it's verion 0.23
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
kewp
kewp14mo ago
Ok will do
kewp
kewp14mo ago
BTW how could I implement this expression without this new expression builder stuff ?
Igal
Igal14mo ago
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()
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
kewp
kewp14mo ago
Thanks so much That works great
Want results from more Discord servers?
Add your server
More Posts