Skip to content

Commit a7abe0f

Browse files
committed
add appendSerializedValue.
1 parent 611eb0c commit a7abe0f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/query-compiler/default-query-compiler.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,10 @@ export class DefaultQueryCompiler
502502
protected override visitValue(node: ValueNode): void {
503503
if (node.immediate) {
504504
this.appendImmediateValue(node.value)
505+
} else if (node.serialized) {
506+
this.appendSerializedValue(node.value)
505507
} else {
506-
this.appendValue(
507-
node.serialized && node.value !== null
508-
? JSON.stringify(node.value)
509-
: node.value,
510-
)
508+
this.appendValue(node.value)
511509
}
512510
}
513511

@@ -1671,6 +1669,14 @@ export class DefaultQueryCompiler
16711669
this.append(this.getCurrentParameterPlaceholder())
16721670
}
16731671

1672+
protected appendSerializedValue(parameter: unknown): void {
1673+
if (parameter === null) {
1674+
this.appendValue(null)
1675+
} else {
1676+
this.appendValue(JSON.stringify(parameter))
1677+
}
1678+
}
1679+
16741680
protected getLeftIdentifierWrapper(): string {
16751681
return '"'
16761682
}

0 commit comments

Comments
 (0)