orchid-orm 1.35.16 → 1.35.18
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 +2 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Query, SelectableFromShape, CreateMethodsNames, CreateData, AddQueryDefaults, RelationConfigBase, UpdateData, WhereArg, JoinQueryMethod, DeleteMethodsNames, Db, IsolationLevel, TransactionOptions, Adapter, FromArg, FromResult, AdapterOptions, DbSharedOptions, RelationJoinQuery, RelationQuery, RelationsBase, ShapeColumnPrimaryKeys, ShapeUniqueColumns, TableDataItemsUniqueColumns, TableDataItemsUniqueColumnTuples, UniqueConstraints, TableDataItemsUniqueConstraints, ComputedColumnsFromOptions, MapTableScopesOption, TableDataItem, ComputedOptionsFactory, QueryData, QueryBase, TableDataFn, DbTableOptionScopes, RawSQL, DynamicRawSQL, DefaultSchemaConfig, DefaultColumnTypes, QueryBeforeHook, QueryAfterHook, AfterHook, WhereResult, MergeQuery } from 'pqb';
|
|
2
2
|
export * from 'pqb';
|
|
3
|
-
import { ColumnsShapeBase, EmptyObject, MaybeArray, RecordUnknown, Simplify, ColumnShapeOutput, ColumnShapeInput, ColumnShapeInputPartial, CoreQueryScopes, ColumnSchemaConfig, StaticSQLArgs, QueryColumn, DynamicSQLArg, QueryColumns, QueryReturnType } from 'orchid-core';
|
|
3
|
+
import { ColumnsShapeBase, EmptyObject, MaybeArray, RecordUnknown, Simplify, ColumnShapeOutput, DefaultSelectColumns, ColumnShapeInput, ColumnShapeInputPartial, CoreQueryScopes, ColumnSchemaConfig, StaticSQLArgs, QueryColumn, DynamicSQLArg, QueryColumns, QueryReturnType } from 'orchid-core';
|
|
4
4
|
export * from 'orchid-core';
|
|
5
5
|
|
|
6
6
|
interface RelationCommonOptions<Related extends TableClass = TableClass, Scope extends Query = Query> {
|
|
@@ -433,7 +433,7 @@ interface ORMTableInput {
|
|
|
433
433
|
type Queryable<T extends ORMTableInput> = Simplify<{
|
|
434
434
|
[K in keyof T['columns']['shape']]?: T['columns']['shape'][K]['queryType'];
|
|
435
435
|
}>;
|
|
436
|
-
type Selectable<T extends ORMTableInput> = Simplify<ColumnShapeOutput<T['columns']['shape']
|
|
436
|
+
type Selectable<T extends ORMTableInput> = Simplify<Pick<ColumnShapeOutput<T['columns']['shape']>, DefaultSelectColumns<T['columns']['shape']>>>;
|
|
437
437
|
type Insertable<T extends ORMTableInput> = Simplify<ColumnShapeInput<T['columns']['shape']>>;
|
|
438
438
|
type Updatable<T extends ORMTableInput> = Simplify<ColumnShapeInputPartial<T['columns']['shape']>>;
|
|
439
439
|
type BeforeHookMethod = (cb: QueryBeforeHook) => void;
|
package/dist/index.js
CHANGED
|
@@ -622,10 +622,7 @@ const makeHasOneMethod = (table, relation, relationName, query) => {
|
|
|
622
622
|
returns: "one",
|
|
623
623
|
method: (params) => {
|
|
624
624
|
const throughQuery = table[through](params);
|
|
625
|
-
return query.whereExists(
|
|
626
|
-
throughQuery,
|
|
627
|
-
whereExistsCallback
|
|
628
|
-
);
|
|
625
|
+
return query.whereExists(throughQuery, whereExistsCallback);
|
|
629
626
|
},
|
|
630
627
|
joinQuery: joinQueryChainingHOF(
|
|
631
628
|
reverseJoin2,
|
|
@@ -884,10 +881,7 @@ const makeHasManyMethod = (table, relation, relationName, query) => {
|
|
|
884
881
|
returns: "many",
|
|
885
882
|
method: (params) => {
|
|
886
883
|
const throughQuery = table[through](params);
|
|
887
|
-
return query.whereExists(
|
|
888
|
-
throughQuery,
|
|
889
|
-
whereExistsCallback
|
|
890
|
-
);
|
|
884
|
+
return query.whereExists(throughQuery, whereExistsCallback);
|
|
891
885
|
},
|
|
892
886
|
joinQuery: joinQueryChainingHOF(
|
|
893
887
|
reverseJoin2,
|