1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-12-22 01:58:54 +00:00

docs(adonis): initialize query builder section

This commit is contained in:
Julien Le Coupanec 2020-04-27 23:07:31 +02:00
parent 8168181146
commit 6e7dc502d2

View File

@ -277,6 +277,38 @@ instance.merge(jsonAttributes) // Modifies the specified attribute
instance.save() // Save the instance to the database.
instance.delete() // Delete model instance from the database.
/********************************************************************************************
* QUERY BUILDER
* https://adonisjs.com/docs/query-builder
* http://knexjs.org/
********************************************************************************************/
const Database = use('Database')
// Available where clauses
where(~mixed~)
orWhere(~mixed~)
whereNot(~mixed~)
orWhereNot(~mixed~)
whereIn(column|columns, array|callback|builder)
orWhereIn(column | columns, array | callback | builder)
whereNotIn(column, array|callback|builder)
orWhereNotIn(column, array | callback | builder)
whereNull(column)
orWhereNull(column)
whereNotNull(column)
orWhereNotNull(column)
whereExists(builder | callback)
orWhereExists(builder | callback)
whereNotExists(builder | callback)
orWhereNotExists(builder | callback)
whereBetween(column, range)
orWhereBetween(column, range)
whereNotBetween(column, range)
orWhereNotBetween(column, range)
whereRaw(query, [bindings])
/********************************************************************************************
* DATABASE HOOKS
* https://adonisjs.com/docs/database-hooks