remult 3.3.19-next.2 → 3.3.19-next.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.
@@ -554,11 +554,14 @@ export interface Repository<entityType> {
554
554
  */
555
555
  save(item: Partial<MembersOnly<entityType>>[], options?: InsertOrUpdateOptions): Promise<entityType[]>;
556
556
  save(item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
557
- /**Insert an item or item[] to the data source
557
+ /**Insert an item or item[] to the data source.
558
+ * Arrays insert one-by-one by default. Pass `{ bulk: true }` for one provider statement/txn.
558
559
  * @example
559
560
  * await taskRepo.insert({title:"task a"})
560
561
  * @example
561
562
  * await taskRepo.insert([{title:"task a"}, {title:"task b", completed:true }])
563
+ * @example
564
+ * await taskRepo.insert([{title:"a"}, {title:"b"}], { bulk: true })
562
565
  */
563
566
  insert(item: Partial<MembersOnly<entityType>>[], options?: InsertOrUpdateOptions): Promise<entityType[]>;
564
567
  insert(item: Partial<MembersOnly<entityType>>, options?: InsertOrUpdateOptions): Promise<entityType>;
@@ -1198,7 +1201,17 @@ export declare type EntitySelectFields<entityType> = {
1198
1201
  [Properties in keyof Partial<MembersOnly<entityType>>]?: boolean;
1199
1202
  };
1200
1203
  export declare type InsertOrUpdateOptions = {
1201
- select: 'none';
1204
+ select?: 'none';
1205
+ /**
1206
+ * One provider statement/txn (SQL multi-row `INSERT`, IDB one txn).
1207
+ *
1208
+ * Default / omitted (`false`): `insert([a,b,c])` inserts one-by-one so
1209
+ * `saving` and `Validators.unique` see prior rows in the same call.
1210
+ *
1211
+ * When `true`: all `saving` hooks run before any write; `Validators.unique`
1212
+ * / `count()` only see the DB, not siblings in the same array.
1213
+ */
1214
+ bulk?: boolean;
1202
1215
  };
1203
1216
  export interface ClassFieldDecoratorContextStub<entityType, valueType> {
1204
1217
  readonly access: {