orchid-orm 1.68.1 → 1.68.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 CHANGED
@@ -28,7 +28,7 @@ interface HasOneInfo<T extends RelationConfigSelf, Name extends string, Rel exte
28
28
  query: Q;
29
29
  params: HasOneParams<T, Rel['options']>;
30
30
  maybeSingle: T['relations'][Name]['options']['required'] extends true ? QueryManyTake<Q> : QueryManyTakeOptional<Q>;
31
- omitForeignKeyInCreate: never;
31
+ columnsForCreate: never;
32
32
  optionalDataForCreate: T['relations'][Name]['options'] extends RelationThroughOptions ? EmptyObject : { [P in Name]?: RelationToOneDataForCreate<{
33
33
  nestedCreateQuery: CreateData<Q>;
34
34
  table: Q;
@@ -68,7 +68,7 @@ interface HasManyInfo<T extends RelationConfigSelf, Name extends string, Rel ext
68
68
  query: Q;
69
69
  params: HasOneParams<T, Rel['options']>;
70
70
  maybeSingle: Q;
71
- omitForeignKeyInCreate: never;
71
+ columnsForCreate: never;
72
72
  optionalDataForCreate: { [P in Name]?: T['relations'][Name]['options'] extends RelationThroughOptions ? EmptyObject : {
73
73
  create?: CreateData<Q>[];
74
74
  connect?: WhereArg<Q>[];
@@ -122,11 +122,8 @@ interface BelongsToInfo<T extends RelationConfigSelf, Name extends string, FK ex
122
122
  query: Q;
123
123
  params: BelongsToParams<T, FK>;
124
124
  maybeSingle: Required extends true ? QueryManyTake<Q> : QueryManyTakeOptional<Q>;
125
- omitForeignKeyInCreate: FK;
126
- dataForCreate: {
127
- columns: FK;
128
- nested: Required extends true ? { [Key in Name]: RelationToOneDataForCreateSameQuery<Q> } : { [Key in Name]?: RelationToOneDataForCreateSameQuery<Q> };
129
- };
125
+ columnsForCreate: FK;
126
+ dataForCreate: { [Key in Name]?: RelationToOneDataForCreateSameQuery<Q> };
130
127
  optionalDataForCreate: EmptyObject;
131
128
  dataForUpdate: {
132
129
  disconnect: boolean;
@@ -281,6 +278,8 @@ interface OrchidORMMethods {
281
278
  * SQL session options (`role` and `setConfig`) cannot be nested.
282
279
  * If an outer scope already has `role` or `setConfig`, attempting to set them again
283
280
  * in a nested `$withOptions` call will throw an error.
281
+ * For transaction-bound work that needs nested overrides, pass `role` and
282
+ * `setConfig` to nested `$transaction` calls instead.
284
283
  * Nested scopes that only change `log` or `schema` will inherit the outer SQL session context.
285
284
  *
286
285
  * Explicit transactions inside the callback inherit the same SQL session context:
@@ -305,6 +304,9 @@ interface OrchidORMMethods {
305
304
  * );
306
305
  * ```
307
306
  *
307
+ * When the request's DB work should run in one transaction, prefer passing
308
+ * `role` and `setConfig` directly to `$transaction`.
309
+ *
308
310
  * Basic usage with `log` and `schema`:
309
311
  *
310
312
  * ```ts
@@ -356,7 +358,7 @@ interface HasAndBelongsToManyInfo<T extends RelationConfigSelf, Name extends str
356
358
  query: Q;
357
359
  params: HasAndBelongsToManyParams<T, FK>;
358
360
  maybeSingle: Q;
359
- omitForeignKeyInCreate: never;
361
+ columnsForCreate: never;
360
362
  optionalDataForCreate: { [P in Name]?: {
361
363
  create?: CreateData<Q>[];
362
364
  connect?: WhereArg<Q>[];