diff --git a/lib/mobility-core/src/Kernel/Types/Geofencing.hs b/lib/mobility-core/src/Kernel/Types/Geofencing.hs index 99a51d53..17b8864a 100644 --- a/lib/mobility-core/src/Kernel/Types/Geofencing.hs +++ b/lib/mobility-core/src/Kernel/Types/Geofencing.hs @@ -13,9 +13,11 @@ -} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE StandaloneDeriving #-} +{-# OPTIONS_GHC -Wno-orphans #-} module Kernel.Types.Geofencing where +import qualified Data.Text as T import qualified Data.Vector as V import qualified Database.Beam as B import Database.Beam.Backend @@ -44,9 +46,9 @@ fromFieldEnum' f mbValue = case mbValue of instance FromField GeoRestriction where fromField = fromFieldEnum' -instance HasSqlValueSyntax be String => HasSqlValueSyntax be GeoRestriction where - sqlValueSyntax Unrestricted = autoSqlValueSyntax Unrestricted - sqlValueSyntax (Regions regions) = autoSqlValueSyntax regions +instance HasSqlValueSyntax be Text => HasSqlValueSyntax be GeoRestriction where + sqlValueSyntax Unrestricted = sqlValueSyntax $ T.pack "Unrestricted" + sqlValueSyntax (Regions regions) = sqlValueSyntax $ "{" <> T.intercalate "," regions <> "}" instance BeamSqlBackend be => B.HasSqlEqualityCheck be GeoRestriction