orchid-orm 1.49.8 → 1.50.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.
- package/dist/index.d.ts +9 -2
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -0
- 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 { 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, QueryBeforeHook, QueryAfterHook, AfterHook, WhereResult, MergeQuery } from 'pqb';
|
|
2
2
|
export * from 'pqb';
|
|
3
|
-
import { ColumnsShapeBase, ColumnShapeInputPartial, EmptyObject, MaybeArray, RecordUnknown, ShallowSimplify, ColumnShapeOutput, DefaultSelectColumns, QueryColumn, ColumnShapeInput, IsQuery, CoreQueryScopes, ColumnSchemaConfig, StaticSQLArgs, DynamicSQLArg, QueryColumns, QueryReturnType } from 'orchid-core';
|
|
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';
|
|
5
5
|
|
|
6
6
|
interface RelationRefsOptions<Column extends PropertyKey = string, Shape extends ColumnsShapeBase = ColumnsShapeBase> {
|
|
@@ -199,6 +199,9 @@ declare function ensureTransaction<Result>(this: {
|
|
|
199
199
|
declare function isInTransaction(this: {
|
|
200
200
|
$queryBuilder: Db;
|
|
201
201
|
}): boolean;
|
|
202
|
+
declare function afterCommit(this: {
|
|
203
|
+
$queryBuilder: Db;
|
|
204
|
+
}, hook: AfterCommitStandaloneHook): void;
|
|
202
205
|
|
|
203
206
|
interface FromQuery extends Query {
|
|
204
207
|
returnType: 'all';
|
|
@@ -215,9 +218,13 @@ type OrchidORM<T extends TableClasses = TableClasses> = {
|
|
|
215
218
|
*/
|
|
216
219
|
$ensureTransaction: typeof ensureTransaction;
|
|
217
220
|
/**
|
|
218
|
-
* @see import('pqb').Transaction.prototype.
|
|
221
|
+
* @see import('pqb').Transaction.prototype.isInTransaction
|
|
219
222
|
*/
|
|
220
223
|
$isInTransaction: typeof isInTransaction;
|
|
224
|
+
/**
|
|
225
|
+
* @see import('pqb').Transaction.prototype.afterCommit
|
|
226
|
+
*/
|
|
227
|
+
$afterCommit: typeof afterCommit;
|
|
221
228
|
$adapter: Adapter;
|
|
222
229
|
$queryBuilder: Db;
|
|
223
230
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2061,6 +2061,9 @@ function ensureTransaction(cb) {
|
|
|
2061
2061
|
function isInTransaction() {
|
|
2062
2062
|
return this.$queryBuilder.isInTransaction();
|
|
2063
2063
|
}
|
|
2064
|
+
function afterCommit(hook) {
|
|
2065
|
+
this.$queryBuilder.afterCommit(hook);
|
|
2066
|
+
}
|
|
2064
2067
|
|
|
2065
2068
|
const orchidORM = ({
|
|
2066
2069
|
log,
|
|
@@ -2097,6 +2100,7 @@ const orchidORM = ({
|
|
|
2097
2100
|
$transaction: transaction,
|
|
2098
2101
|
$ensureTransaction: ensureTransaction,
|
|
2099
2102
|
$isInTransaction: isInTransaction,
|
|
2103
|
+
$afterCommit: afterCommit,
|
|
2100
2104
|
$adapter: adapter,
|
|
2101
2105
|
$queryBuilder: qb,
|
|
2102
2106
|
$query: (...args) => qb.query(...args),
|