Skip to content

Instantly share code, notes, and snippets.

@thetutlage
Created June 27, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thetutlage/3aabed691d0a86c950bd3a413d9acf67 to your computer and use it in GitHub Desktop.
Save thetutlage/3aabed691d0a86c950bd3a413d9acf67 to your computer and use it in GitHub Desktop.
Adonis Database query builder select queries
// All users
await Database.from('users').select('*')
// Get admin users
await Database.from('users').where('role', 'admin')
// Inactive users
await Database
.from('users')
.where('status', 'inactive')
.orWhere('suspended', true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment