From 9b31d2490042f8938a7fabc0bcb8e1ecfc00870d Mon Sep 17 00:00:00 2001 From: Mihael Isaev Date: Mon, 26 Oct 2020 09:45:21 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Enum=20array=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Bridges/Helpers/Table+AllColumns.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Bridges/Helpers/Table+AllColumns.swift b/Sources/Bridges/Helpers/Table+AllColumns.swift index 8701229..2a65b75 100644 --- a/Sources/Bridges/Helpers/Table+AllColumns.swift +++ b/Sources/Bridges/Helpers/Table+AllColumns.swift @@ -6,6 +6,7 @@ // import Foundation +import SwifQL extension Table { typealias Columns = [(name: String, value: SwifQLable, isChanged: Bool)] @@ -13,7 +14,11 @@ extension Table { func allColumns() -> Columns { columns.compactMap { let value: SwifQLable - if let v = $0.property.inputValue as? SwifQLPart { + if let v = ($0.property.inputValue as Any) as? [AnySwifQLEnum] { + let values = v.compactMap { $0.anyRawValue as? String }.joined(separator: ",") + let preparedPart = SwifQLPartSafeValue("{\(values)}") + value = SwifQLableParts(parts: [preparedPart]) + } else if let v = $0.property.inputValue as? SwifQLPart { value = SwifQLableParts(parts: [v]) } else if let v = $0.property.inputValue as? SwifQLable { value = v