2020-12-03 15:21:27 +03:00
|
|
|
module Hasura.Backends.Postgres.Translate.Column
|
|
|
|
( toTxtValue
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Hasura.Prelude
|
|
|
|
|
|
|
|
import Hasura.Backends.Postgres.SQL.DML
|
|
|
|
import Hasura.Backends.Postgres.SQL.Value
|
2021-03-25 20:50:08 +03:00
|
|
|
import Hasura.Backends.Postgres.Types.Column
|
2021-02-14 09:07:52 +03:00
|
|
|
import Hasura.RQL.Types.Column
|
|
|
|
import Hasura.SQL.Backend
|
2020-12-03 15:21:27 +03:00
|
|
|
|
|
|
|
|
2021-04-22 00:44:37 +03:00
|
|
|
toTxtValue :: ColumnValue ('Postgres pgKind) -> SQLExp
|
2020-12-03 15:21:27 +03:00
|
|
|
toTxtValue ColumnValue{..} =
|
|
|
|
withTyAnn ty . withConstructorFn ty $ txtEncoder cvValue
|
|
|
|
where
|
|
|
|
ty = unsafePGColumnToBackend cvType
|