pqb 0.5.1 → 0.5.2

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.esm.js CHANGED
@@ -4202,13 +4202,13 @@ const processCreateItem = (item, rowIndex, ctx, columns, encoders, columnsMap, s
4202
4202
  item[key]
4203
4203
  ]);
4204
4204
  } else {
4205
+ const value = item[key];
4206
+ if ((!value.create || Array.isArray(value.create) && value.create.length === 0) && (!value.connect || Array.isArray(value.connect) && value.connect.length === 0) && (!value.connectOrCreate || Array.isArray(value.connectOrCreate) && value.connectOrCreate.length === 0))
4207
+ return;
4205
4208
  ctx.requiredReturning[ctx.relations[key].primaryKey] = true;
4206
4209
  if (!ctx.appendRelations[key])
4207
4210
  ctx.appendRelations[key] = [];
4208
- ctx.appendRelations[key].push([
4209
- rowIndex,
4210
- item[key]
4211
- ]);
4211
+ ctx.appendRelations[key].push([rowIndex, value]);
4212
4212
  }
4213
4213
  } else if (columnsMap[key] === void 0 && (shape[key] || shape === anyShape)) {
4214
4214
  columnsMap[key] = columns.length;
@@ -5151,6 +5151,9 @@ class Update {
5151
5151
  if (relations[key].type === "belongsTo") {
5152
5152
  prependRelations[key] = data[key];
5153
5153
  } else {
5154
+ const value = data[key];
5155
+ if (!value.set && !("upsert" in value) && (!value.disconnect || Array.isArray(value.disconnect) && value.disconnect.length === 0) && (!value.delete || Array.isArray(value.delete) && value.delete.length === 0) && (!value.update || Array.isArray(value.update.where) && value.update.where.length === 0) && (!value.create || Array.isArray(value.create) && value.create.length === 0))
5156
+ continue;
5154
5157
  if (!((_a = query.select) == null ? void 0 : _a.includes("*"))) {
5155
5158
  const primaryKey = relations[key].primaryKey;
5156
5159
  if (!((_b = query.select) == null ? void 0 : _b.includes(primaryKey))) {