Skip to content

Commit

Permalink
add appendSerializedValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Sep 2, 2024
1 parent 536fd9b commit 8e3dbf7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/query-compiler/default-query-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,10 @@ export class DefaultQueryCompiler
protected override visitValue(node: ValueNode): void {
if (node.immediate) {
this.appendImmediateValue(node.value)
} else if (node.serialized) {
this.appendSerializedValue(node.value)
} else {
this.appendValue(
node.serialized && node.value !== null
? JSON.stringify(node.value)
: node.value,
)
this.appendValue(node.value)
}
}

Expand Down Expand Up @@ -1665,6 +1663,14 @@ export class DefaultQueryCompiler
this.append(this.getCurrentParameterPlaceholder())
}

protected appendSerializedValue(parameter: unknown): void {
if (parameter === null) {
this.appendValue(null)
} else {
this.appendValue(JSON.stringify(parameter))
}
}

protected getLeftIdentifierWrapper(): string {
return '"'
}
Expand Down

0 comments on commit 8e3dbf7

Please sign in to comment.