Select increment counter in mysql

Here is mysql query

select name from tbl_name

I want to select an increment counter along side name.How to do this. so the expected output will be

1  jhon
2  svelte
3 adonis
4 rambo

how can i do in adonisjs

select id, name from tbl_name

If you are using Lucid, then:

const User = use('App/Models/User')

const user = await User.query()
  .select('id', 'name')
1 Like