There seems to be a problem with
whereRaw(). i have looked at the source (knex) where my code throws the error on /src/raw.js on line 138. I have also looked at example of how
whereRaw() is used as well as the docs.
I am using a ServiceRides Lucid model (and also UUIDs - v1)
let query = ServiceRides.query(); await query.select(query.db.knex.raw('YEAR(created_at) as year_of_trip')) .whereRaw('tenant_id = ? AND completed = ? AND YEAR(created_at) >= ? AND YEAR(created_at) <= ?', ["30fb73d0-9e3d-11e9-bd80-3741ce1df8fb", 1, 2018, 2019]) .groupByRaw('YEAR(created_at)') .orderByRaw('YEAR(created_at) DESC')
The above code throws Error Expected 1 bindings, saw 0
Someone ( @elihigu ) of the knex core team could not reproduce the error here for knex v0.18.2 however this error surfaces in knex v0.16.3 (used in adonis-lucid 6.1.3).
Please, what to do ? Help me please… (NB: The only problem here is the