From c42811382e1c7104d3119ea34fb470b089ca8299 Mon Sep 17 00:00:00 2001 From: Markus <115093421+markus-codewrangler@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:45:58 +0200 Subject: [PATCH] extend docs for `orderByRaw` according to source code --- src/guide/query-builder.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/guide/query-builder.md b/src/guide/query-builder.md index 4329d194..428fc58e 100644 --- a/src/guide/query-builder.md +++ b/src/guide/query-builder.md @@ -2705,7 +2705,7 @@ knex('users').orderBy([ ### orderByRaw -**.orderByRaw(sql)** +**.orderByRaw(sql, [bindings])** Adds an order by raw clause to the query. @@ -2713,6 +2713,10 @@ Adds an order by raw clause to the query. knex.select('*') .from('table') .orderByRaw('col DESC NULLS LAST') + +knex.select('*') + .from('table') + .orderByRaw('json_col->>? DESC NULLS LAST', 'myField') ``` ## Having Clauses