orchid-orm 1.52.0 → 1.53.0
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 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableData, Query, SelectableFromShape, CreateMethodsNames, CreateData, CreateBelongsToData, AddQueryDefaults, RelationConfigBase, QueryTake, QueryTakeOptional, UpdateData, WhereArg, JoinQueryMethod, DeleteMethodsNames, Db, IsolationLevel, TransactionOptions, Adapter, FromArg, FromResult, AdapterOptions, DbSharedOptions, RelationsBase, ShapeColumnPrimaryKeys, ShapeUniqueColumns, TableDataItemsUniqueColumns, TableDataItemsUniqueColumnTuples, UniqueConstraints, TableDataItemsUniqueConstraints, ComputedColumnsFromOptions, MapTableScopesOption, TableDataItem, ComputedOptionsFactory, ComputedOptionsConfig, QueryOrExpression, QueryData, TableDataFn, DbTableOptionScopes, RawSQL, DynamicRawSQL, DefaultSchemaConfig, DefaultColumnTypes,
|
|
1
|
+
import { TableData, Query, SelectableFromShape, CreateMethodsNames, CreateData, CreateBelongsToData, AddQueryDefaults, RelationConfigBase, QueryTake, QueryTakeOptional, UpdateData, WhereArg, JoinQueryMethod, DeleteMethodsNames, Db, IsolationLevel, TransactionOptions, Adapter, FromArg, FromResult, AdapterOptions, DbSharedOptions, RelationsBase, ShapeColumnPrimaryKeys, ShapeUniqueColumns, TableDataItemsUniqueColumns, TableDataItemsUniqueColumnTuples, UniqueConstraints, TableDataItemsUniqueConstraints, ComputedColumnsFromOptions, MapTableScopesOption, TableDataItem, ComputedOptionsFactory, ComputedOptionsConfig, QueryOrExpression, QueryData, TableDataFn, DbTableOptionScopes, RawSQL, DynamicRawSQL, DefaultSchemaConfig, DefaultColumnTypes, QueryBeforeHookInternal, QueryAfterHook, AfterHook, WhereResult, MergeQuery } from 'pqb';
|
|
2
2
|
export * from 'pqb';
|
|
3
3
|
import { ColumnsShapeBase, ColumnShapeInputPartial, EmptyObject, MaybeArray, AfterCommitStandaloneHook, RecordUnknown, ShallowSimplify, ColumnShapeOutput, DefaultSelectColumns, QueryColumn, ColumnShapeInput, IsQuery, CoreQueryScopes, ColumnSchemaConfig, StaticSQLArgs, DynamicSQLArg, QueryColumns, QueryReturnType } from 'orchid-core';
|
|
4
4
|
export * from 'orchid-core';
|
|
@@ -472,7 +472,7 @@ type Selectable<T extends ORMTableInput> = T['computed'] extends ((t: never) =>
|
|
|
472
472
|
}> : ShallowSimplify<ColumnShapeOutput<T['columns']['shape']>>;
|
|
473
473
|
type Insertable<T extends ORMTableInput> = ShallowSimplify<ColumnShapeInput<T['columns']['shape']>>;
|
|
474
474
|
type Updatable<T extends ORMTableInput> = ShallowSimplify<ColumnShapeInputPartial<T['columns']['shape']>>;
|
|
475
|
-
type BeforeHookMethod = (cb:
|
|
475
|
+
type BeforeHookMethod = (cb: QueryBeforeHookInternal) => void;
|
|
476
476
|
type AfterHookMethod = (cb: QueryAfterHook) => void;
|
|
477
477
|
type AfterSelectableHookMethod = <Shape extends QueryColumns, S extends (keyof Shape)[]>(this: {
|
|
478
478
|
columns: {
|
package/dist/index.js
CHANGED
|
@@ -598,7 +598,7 @@ const nestedUpdate$3 = ({ query, primaryKeys, foreignKeys, len }) => {
|
|
|
598
598
|
throw new Error("`upsert` option is not allowed in a batch update");
|
|
599
599
|
}
|
|
600
600
|
let idsForDelete;
|
|
601
|
-
pqb._queryHookBeforeUpdate(q, async (q2) => {
|
|
601
|
+
pqb._queryHookBeforeUpdate(q, async ({ query: q2 }) => {
|
|
602
602
|
if (params.disconnect) {
|
|
603
603
|
for (const key of foreignKeys) {
|
|
604
604
|
update[key] = null;
|
|
@@ -854,7 +854,6 @@ const makeHasOneMethod = (tableConfig, table, relation, relationName, query) =>
|
|
|
854
854
|
const baseQuery = query2.clone();
|
|
855
855
|
baseQuery.q.select = fromQuerySelect;
|
|
856
856
|
const q = relationQuery.q;
|
|
857
|
-
q.kind = "from";
|
|
858
857
|
q.values = { from: baseQuery };
|
|
859
858
|
};
|
|
860
859
|
}
|
|
@@ -1132,7 +1131,6 @@ const makeHasManyMethod = (tableConfig, table, relation, relationName, query) =>
|
|
|
1132
1131
|
const baseQuery = query2.clone();
|
|
1133
1132
|
baseQuery.q.select = fromQuerySelect;
|
|
1134
1133
|
const q = relationQuery.q;
|
|
1135
|
-
q.kind = "from";
|
|
1136
1134
|
q.values = { from: baseQuery };
|
|
1137
1135
|
};
|
|
1138
1136
|
}
|