orchid-orm 1.17.22 → 1.17.24
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 +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Query, QueryWithTable, SetQueryTableAlias, WhereArg, UpdateData, CreateData, Db, IsolationLevel, TransactionOptions, Adapter, FromArgs, FromResult, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption,
|
|
1
|
+
import { Query, QueryWithTable, SetQueryTableAlias, WhereArg, UpdateData, CreateData, Db, IsolationLevel, TransactionOptions, Adapter, FromArgs, FromResult, AdapterOptions, QueryLogOptions, NoPrimaryKeyOption, RelationQuery, RelationConfigBase, RelationQueryBase, ComputedColumnsBase, QueryData, QueryBase, DefaultColumnTypes, QueryBeforeHook, QueryAfterHook, AfterHook, WhereResult, MergeQuery, SetQueryReturns, QueryReturnType } from 'pqb';
|
|
2
2
|
export { OrchidOrmError, OrchidOrmInternalError, columnTypes, raw, testTransaction } from 'pqb';
|
|
3
3
|
import { EmptyObject, MaybeArray, StringKey, ColumnsShapeBase, ColumnShapeQueryType, ColumnShapeOutput, ColumnShapeInput } from 'orchid-core';
|
|
4
4
|
|
|
@@ -338,7 +338,7 @@ type RelationThunks = Record<string, RelationThunk>;
|
|
|
338
338
|
type RelationScopeOrTable<Relation extends RelationThunkBase> = Relation['options']['scope'] extends (q: Query) => Query ? ReturnType<Relation['options']['scope']> : RelationQueryFromFn<Relation>;
|
|
339
339
|
type RelationQueryFromFn<Relation extends RelationThunkBase, TC extends TableClass = ReturnType<Relation['fn']>, Q extends Query = DbTable<TC>> = Q;
|
|
340
340
|
type RelationConfig<T extends Table = Table, Relations extends RelationThunks = RelationThunks, Relation extends RelationThunk = RelationThunk, K extends PropertyKey = PropertyKey, Result extends RelationConfigBase = Relation extends BelongsTo ? BelongsToInfo<T, Relation, StringKey<K>> : Relation extends HasOne ? HasOneInfo<T, Relations, Relation, StringKey<K>> : Relation extends HasMany ? HasManyInfo<T, Relations, Relation, StringKey<K>> : Relation extends HasAndBelongsToMany ? HasAndBelongsToManyInfo<T, Relation, StringKey<K>> : never> = Result;
|
|
341
|
-
type MapRelation<T extends Table, Relations extends RelationThunks, RelationName extends keyof Relations, Relation extends RelationThunk = Relations[RelationName]
|
|
341
|
+
type MapRelation<T extends Table, Relations extends RelationThunks, RelationName extends keyof Relations, Relation extends RelationThunk = Relations[RelationName]> = RelationQuery<RelationName, RelationConfig<T, Relations, Relation, RelationName>, RelationScopeOrTable<Relation>>;
|
|
342
342
|
type MapRelations<T extends Table> = T extends {
|
|
343
343
|
relations: RelationThunks;
|
|
344
344
|
} ? {
|
package/dist/index.js
CHANGED
|
@@ -1582,7 +1582,7 @@ const makeRelationQuery = (table, relationName, data, q) => {
|
|
|
1582
1582
|
get() {
|
|
1583
1583
|
var _a;
|
|
1584
1584
|
const toTable = q.clone();
|
|
1585
|
-
const query = this.q.isSubQuery ? toTable : toTable._whereExists(
|
|
1585
|
+
const query = this.q.isSubQuery ? toTable : toTable._all()._whereExists(
|
|
1586
1586
|
this.baseQuery,
|
|
1587
1587
|
(q2) => data.reverseJoin(this, toTable)
|
|
1588
1588
|
);
|