Skip to content

Commit fd49e7f

Browse files
committed
readme
1 parent 3628c30 commit fd49e7f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ be used together with ``limit`` parameter.
5959
- `count` - will return record count.
6060
- `soft_deleted` - will include soft deleted models in search results.
6161
- `doesnt_have_relations` - will only return entries that don't have any of the specified relations.
62+
- `use_raw_arguments` - will use raw SQL for group_by (groupByRaw) & returns (selectRaw)
6263

6364
### Search
6465

@@ -116,6 +117,23 @@ case-insensitive search.
116117
Will perform a ``SELECT * FROM some_table WHERE first_name LIKE 'foo' AND
117118
last_name NOT LIKE 'bar'``.
118119

120+
Example with raw query
121+
{
122+
"search": {
123+
...
124+
},
125+
"group_by": ["year", "month"],
126+
"order_by": ["year", "month"],
127+
"returns": ["DATE_PART('Year', created_at) AS year", "DATE_PART('Month', created_at) AS month", "COUNT(*) AS total"],
128+
"use_raw_arguments": 1
129+
}
130+
131+
Will perform:
132+
``select DATE_PART(\'Year\', created_at) AS year, DATE_PART(\'Month\', created_at) AS month, COUNT(*) AS total
133+
from ....
134+
group by year, month order by "year" asc, "month" asc``
135+
136+
119137
#### Micro operators
120138

121139
- `!` - negates the value. Works only on the beginning of the value (i.e. `!value`).

0 commit comments

Comments
 (0)