Making sure all JSON column types are correctly handled.

This commit is contained in:
mike12345567 2024-05-23 15:00:13 +01:00
parent 0c28d05d40
commit 66686fd970
2 changed files with 12 additions and 3 deletions

View File

@ -20,6 +20,7 @@ import {
INTERNAL_TABLE_SOURCE_ID,
SqlClient,
QueryOptions,
JsonTypes,
} from "@budibase/types"
import environment from "../environment"
import { helpers } from "@budibase/shared-core"
@ -796,9 +797,8 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
field: FieldSchema
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
return (
field.type === FieldType.JSON ||
(field.type === FieldType.BB_REFERENCE &&
!helpers.schema.isDeprecatedSingleUserColumn(field))
JsonTypes.includes(field.type) &&
!helpers.schema.isDeprecatedSingleUserColumn(field)
)
}

View File

@ -118,6 +118,15 @@ export enum FieldType {
BB_REFERENCE_SINGLE = "bb_reference_single",
}
export const JsonTypes = [
FieldType.ATTACHMENT_SINGLE,
FieldType.BB_REFERENCE_SINGLE,
FieldType.ATTACHMENTS,
FieldType.BB_REFERENCE,
FieldType.JSON,
FieldType.ARRAY,
]
export interface RowAttachment {
size: number
name: string