I have query:
select user_id, sum(total) as total from transaction group by user_id
Currently, in adonis i will write code like this
await Database.raw('select user_id, sum(total) as total from transaction group by user_id')
Hopefully next time you can add function selectRaw, so my code will be simpler like this:
await Database.table('transaction').selectRaw('user_id, sum(total) as total').groupBy('user_id')
How about
Database.table('transaction').select('user_id').sum('total as total').groupBy('user_id')
Thanks @thetutlage.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
How about