Created
June 27, 2018 08:56
-
-
Save thetutlage/3aabed691d0a86c950bd3a413d9acf67 to your computer and use it in GitHub Desktop.
Adonis Database query builder select queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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