querier-ts 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +18 -11
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.7.1
4
+
5
+ ### Summary
6
+
7
+ - [x] Documentation updates
8
+ - [ ] Bug fixes
9
+ - [ ] Code refactoring
10
+ - [ ] New features
11
+ - [ ] Breaking changes
12
+
13
+ ### New features
14
+
15
+ - Update `README.md` documentation for `orderBy()` method with new overload and examples.
16
+
3
17
  ## v2.7.0
4
18
 
5
19
  ### Summary
package/README.md CHANGED
@@ -144,23 +144,30 @@ const query = Query.from()
144
144
 
145
145
  ### Ordering results
146
146
 
147
- #### `orderBy(...columns)`
147
+ #### `orderBy(...columns | (callback, order?))`
148
148
 
149
- Sorts the results. You can pass multiple columns.
149
+ Sorts the results.
150
150
 
151
- ```ts
152
- .orderBy('name', 'id')
153
- ```
151
+ - `columns`: the columns to order by.
152
+ - `callback`: A function that maps each row to a value.
153
+ - `order`: The order to sort in.
154
154
 
155
- In this example, `name` has higher priority than `id`.
155
+ You can specify column names or a callback function to map each row to a value.
156
156
 
157
- You can also sort in descending order by prefixing the column with `-`:
157
+ Examples:
158
158
 
159
159
  ```ts
160
- const lastId = Query.from(users)
161
- .select('id')
162
- .orderBy('-id')
163
- .scalar();
160
+ // Column names with ASC and DESC (-) order
161
+ .orderBy('name', '-createdAt')
162
+
163
+ // callback with ASC order by default
164
+ .orderBy((user) => user.address.country)
165
+
166
+ // callback with ASC order set explicitly
167
+ .orderBy((user) => user.address.country, 'asc')
168
+
169
+ // callback with DESC order
170
+ .orderBy((user) => user.address.country, 'desc')
164
171
  ```
165
172
 
166
173
  ---
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "querier-ts",
3
3
  "type": "module",
4
- "version": "2.7.0",
4
+ "version": "2.7.1",
5
5
  "description": "A lightweight, type-safe in-memory query engine for JavaScript and TypeScript",
6
6
  "repository": {
7
7
  "type": "git",