1
0
Fork 0
mirror of synced 2024-08-23 05:51:29 +12:00

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