orchid-orm 1.31.2 → 1.31.3
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 +14 -10
- package/dist/index.js.map +1 -1
- 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, SqlMethod, DefaultSchemaConfig, DefaultColumnTypes, QueryBeforeHook, QueryAfterHook, AfterHook, WhereResult, MergeQuery } from 'pqb';
|
|
2
2
|
export * from 'pqb';
|
|
3
|
-
import { ColumnsShapeBase, EmptyObject, MaybeArray,
|
|
3
|
+
import { ColumnsShapeBase, EmptyObject, MaybeArray, RecordUnknown, Simplify, ColumnShapeOutput, ColumnShapeInput, ColumnShapeInputPartial, CoreQueryScopes, ColumnSchemaConfig, 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> {
|
|
@@ -414,19 +414,23 @@ interface Table {
|
|
|
414
414
|
* collect computed columns returned by {@link BaseTable.setColumns}
|
|
415
415
|
*/
|
|
416
416
|
computed?: ComputedOptionsFactory<never, never>;
|
|
417
|
-
scopes?:
|
|
417
|
+
scopes?: RecordUnknown;
|
|
418
418
|
readonly softDelete?: true | string;
|
|
419
419
|
comment?: string;
|
|
420
420
|
}
|
|
421
|
-
type Queryable<T extends Table> = {
|
|
421
|
+
type Queryable<T extends Table> = Simplify<{
|
|
422
422
|
[K in keyof T['columns']['shape']]?: T['columns']['shape'][K]['queryType'];
|
|
423
|
-
}
|
|
424
|
-
type Selectable<T extends Table> = ColumnShapeOutput<T['columns']['shape']
|
|
425
|
-
type Insertable<T extends Table> = ColumnShapeInput<T['columns']['shape']
|
|
426
|
-
type Updatable<T extends Table> = ColumnShapeInputPartial<T['columns']['shape']
|
|
427
|
-
type BeforeHookMethod =
|
|
428
|
-
type AfterHookMethod =
|
|
429
|
-
type AfterSelectableHookMethod = <
|
|
423
|
+
}>;
|
|
424
|
+
type Selectable<T extends Table> = Simplify<ColumnShapeOutput<T['columns']['shape']>>;
|
|
425
|
+
type Insertable<T extends Table> = Simplify<ColumnShapeInput<T['columns']['shape']>>;
|
|
426
|
+
type Updatable<T extends Table> = Simplify<ColumnShapeInputPartial<T['columns']['shape']>>;
|
|
427
|
+
type BeforeHookMethod = (cb: QueryBeforeHook) => void;
|
|
428
|
+
type AfterHookMethod = (cb: QueryAfterHook) => void;
|
|
429
|
+
type AfterSelectableHookMethod = <Shape extends QueryColumns, S extends (keyof Shape)[]>(this: {
|
|
430
|
+
columns: {
|
|
431
|
+
shape: Shape;
|
|
432
|
+
};
|
|
433
|
+
}, select: S, cb: AfterHook<S, Shape>) => void;
|
|
430
434
|
interface SetColumnsResult<Shape extends ColumnsShapeBase, Data extends MaybeArray<MaybeArray<TableDataItem>>> {
|
|
431
435
|
shape: Shape;
|
|
432
436
|
data: Data extends unknown[] ? Data : [Data];
|