Only convert to a string if it is an object.

This commit is contained in:
mike12345567 2025-03-21 20:08:04 +00:00
parent 17a80d044f
commit e5ffb074bc
1 changed files with 6 additions and 2 deletions

View File

@ -391,8 +391,12 @@ class InternalBuilder {
return null
}
// MS-SQL doesn't allow an object to be passed in
if (this.requiresJsonAsStringClient() && isJsonColumn(schema)) {
// some database don't allow an object to be passed in
if (
this.requiresJsonAsStringClient() &&
isJsonColumn(schema) &&
typeof input === "object"
) {
return JSON.stringify(input)
}