Answers for "how to query and join two table with knex"

0

how to query and join two table with knex

const posts = await db('posts')
  .join('users', 'users.id', 'posts.user_id')
  .select('posts.id', 'users.username', 'posts.contents')
  .where({user_id: id})
Posted by: Guest on October-12-2021

Browse Popular Code Answers by Language