mirror of
https://github.com/namibia/awesome-cheatsheets.git
synced 2024-11-21 20:35:12 +00:00
docs(adonis): initialize query builder section
This commit is contained in:
parent
8168181146
commit
6e7dc502d2
@ -277,6 +277,38 @@ instance.merge(jsonAttributes) // Modifies the specified attribute
|
|||||||
instance.save() // Save the instance to the database.
|
instance.save() // Save the instance to the database.
|
||||||
instance.delete() // Delete model instance from 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
|
* DATABASE HOOKS
|
||||||
* https://adonisjs.com/docs/database-hooks
|
* https://adonisjs.com/docs/database-hooks
|
||||||
|
Loading…
Reference in New Issue
Block a user