Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add count method to selects #53

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Add count method to selects #53

merged 1 commit into from
Aug 28, 2024

Conversation

G4brym
Copy link
Owner

@G4brym G4brym commented Aug 27, 2024

  const qs = await qb.select('testTable')
        .fields('*')
        .where('field = ?1', 'test')
        .join({ table: 'employees', on: 'testTable.employee_id = employees.id' })
        .join({ table: 'offices', on: 'testTable.office_id = offices.id' })
        .count(),
  
  console.log(`total is ${qs.results.total}`)

Copy link
Contributor

@LuisDuarte1 LuisDuarte1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great 🚀

@G4brym G4brym merged commit bd67772 into main Aug 28, 2024
3 checks passed
@G4brym G4brym deleted the add-count-method branch August 28, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants