I build api use hapi js and postgresql with ORM objection js (knexjs). I create own function in postgresql with two argument. When I try to call my function use objection .raw
it's doesn't work. This one of the codes that I have tried and it doesn't work:
let _data = await Model.knex().raw('select * from fn_user_profiling('+ Model.knex().raw('??', ['840018']).toString() +', ' + Model.knex().raw('??', ['human capital']).toString() + ')');
This the error when I run the code:
select * from fn_user_profiling("840018", "human capital") - column "840018" does not exist
I try to follow this thred in this link, but not work for me.
I hope advance can help to give the answer or clue to solve this problems.
Thank you very much.