graphql-engine/server/src-lib/Hasura/Backends/Postgres/Translate/Column.hs
Antoine Leblanc ba70ca427a server: switch to a sub-backend approach
GitOrigin-RevId: 660126d5f65620fb58a3ffcbed564e9e35f59938
2021-04-21 21:45:32 +00:00

19 lines
535 B
Haskell

module Hasura.Backends.Postgres.Translate.Column
( toTxtValue
) where
import Hasura.Prelude
import Hasura.Backends.Postgres.SQL.DML
import Hasura.Backends.Postgres.SQL.Value
import Hasura.Backends.Postgres.Types.Column
import Hasura.RQL.Types.Column
import Hasura.SQL.Backend
toTxtValue :: ColumnValue ('Postgres pgKind) -> SQLExp
toTxtValue ColumnValue{..} =
withTyAnn ty . withConstructorFn ty $ txtEncoder cvValue
where
ty = unsafePGColumnToBackend cvType