objection.js icon indicating copy to clipboard operation
objection.js copied to clipboard

Knex supports whereLike() as of v1.0.4 but via Model.query() it's not available.

Open CodisRedding opened this issue 2 years ago • 0 comments

Knex now supports whereLike() as of version 1.0.4 but when using it via Model.query() it's not available. (see pic below)

Which objection version are you using? ^3.0.0 Which knex version are you using? 1.0.7 What are you doing? Running a simple query with a knex whereLike() statement What code are you running? node 14.19.0 What is happening? whereLike() is not available as a function even though I can use it directly via knex What are you expecting to happen instead? whereLike() should be available to use

const response = await PharmacyScriptCounts.query()
            .withGraphFetched('PharmacyMdspMaster')
            .distinct('d_Pharmacy_MDSP_Master.MDSP_Brand_Name')
            .sum('Claim_Count')
            .sum('Virtual_Volume')
            .sum('Member_Count')
            .sum('Client_Cost')
            .sum('Current_Copay')
            .whereLike('d_Pharmacy_MDSP_Master.MDSP_Brand_Name', 'something%')
            .groupBy('d_Pharmacy_MDSP_Master.MDSP_Brand_Name');
  • if I comment out whereLike() it responds, also moving whereLike up the chain doesn't matter
  • if i use whereLike directly via knex() it works
image

CodisRedding avatar Jun 10 '22 15:06 CodisRedding