Skip to content

Commit 14ff081

Browse files
committed
perf improvement
1 parent 6ce9a57 commit 14ff081

File tree

1 file changed

+8
-1
lines changed
  • packages/runtime/src/client/crud/operations

1 file changed

+8
-1
lines changed

packages/runtime/src/client/crud/operations/base.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,17 @@ export abstract class BaseOperationHandler<Schema extends SchemaDef> {
883883
return acc;
884884
}, [] as string[]);
885885
for (const item of createData) {
886+
if (Object.keys(item).length === allPassedFields.length) {
887+
continue;
888+
}
886889
for (const field of allPassedFields) {
887890
if (!(field in item)) {
888891
const fieldDef = this.requireField(model, field);
889-
if (fieldDef.default !== undefined && typeof fieldDef.default !== 'object') {
892+
if (
893+
fieldDef.default !== undefined &&
894+
fieldDef.default !== null &&
895+
typeof fieldDef.default !== 'object'
896+
) {
890897
item[field] = this.dialect.transformPrimitive(
891898
fieldDef.default,
892899
fieldDef.type as BuiltinType,

0 commit comments

Comments
 (0)