pqb 0.18.33 → 0.18.34
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.
- package/dist/index.d.ts +85 -4
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -6183,7 +6183,7 @@ class QueryGet {
|
|
|
6183
6183
|
* It will throw `NotFoundError` when not found.
|
|
6184
6184
|
*
|
|
6185
6185
|
* ```ts
|
|
6186
|
-
* import { NumberColumn } from '
|
|
6186
|
+
* import { NumberColumn } from 'orchid-orm';
|
|
6187
6187
|
*
|
|
6188
6188
|
* const firstName: string = await db.table.get('name');
|
|
6189
6189
|
*
|
|
@@ -7467,7 +7467,7 @@ class JsonModifiers extends QueryBase {
|
|
|
7467
7467
|
* Selects a value from JSON data using a JSON path.
|
|
7468
7468
|
*
|
|
7469
7469
|
* ```ts
|
|
7470
|
-
* import { columnTypes } from '
|
|
7470
|
+
* import { columnTypes } from 'orchid-orm';
|
|
7471
7471
|
*
|
|
7472
7472
|
* db.table.jsonPathQuery(
|
|
7473
7473
|
* columnTypes.text(3, 100), // type of the value
|
|
@@ -8054,7 +8054,7 @@ class With {
|
|
|
8054
8054
|
* Add Common Table Expression (CTE) to the query.
|
|
8055
8055
|
*
|
|
8056
8056
|
* ```ts
|
|
8057
|
-
* import { columnTypes } from '
|
|
8057
|
+
* import { columnTypes } from 'orchid-orm';
|
|
8058
8058
|
* import { NumberColumn } from './number';
|
|
8059
8059
|
*
|
|
8060
8060
|
* // .with optionally accepts such options:
|
|
@@ -8559,7 +8559,7 @@ class Update {
|
|
|
8559
8559
|
* To make sure that at least one row was updated use `updateOrThrow`:
|
|
8560
8560
|
*
|
|
8561
8561
|
* ```ts
|
|
8562
|
-
* import { NotFoundError } from '
|
|
8562
|
+
* import { NotFoundError } from 'orchid-orm';
|
|
8563
8563
|
*
|
|
8564
8564
|
* try {
|
|
8565
8565
|
* // updatedCount is guaranteed to be greater than 0
|
|
@@ -9895,6 +9895,20 @@ class QueryMethods {
|
|
|
9895
9895
|
* await selectFollowing(db.user.select('id', 'name'), currentUser);
|
|
9896
9896
|
* ```
|
|
9897
9897
|
*
|
|
9898
|
+
* To get the result type of query helper, use `QueryHelperResult` type:
|
|
9899
|
+
*
|
|
9900
|
+
* ```ts
|
|
9901
|
+
* import { QueryHelperResult } from 'orchid-orm';
|
|
9902
|
+
*
|
|
9903
|
+
* const selectHelper = db.table.makeHelper((q) => q.select('id', 'name'));
|
|
9904
|
+
*
|
|
9905
|
+
* // This type is identical to `db.table.select('id', 'name')`
|
|
9906
|
+
* type SelectQuery = QueryHelperResult<typeof selectHelper>;
|
|
9907
|
+
*
|
|
9908
|
+
* // Await to get result, the type is `{ id: number, name: string }[]`
|
|
9909
|
+
* type Result = Awaited<QueryHelperResult<typeof selectHelper>>;
|
|
9910
|
+
* ```
|
|
9911
|
+
*
|
|
9898
9912
|
* @param fn - helper function
|
|
9899
9913
|
*/
|
|
9900
9914
|
makeHelper(fn) {
|