Skip to content

persistent-postgresql: Support postgres UUID type #153

@bergmark

Description

@bergmark

I want to use the uuid type in postgres, have it treated as Text and then add a instance PersistField UUID to do the mapping to UUID in Haskell (since postgresql-simple doesn't want to depend on a specific uuid implementation: lpsmith/postgresql-simple#10).

But if you have a uuid type in a postgres db schema and try to interact with it you get an error from persistent-postgresql:

Postgresql.getGetter: type UUID not supported.

I tried adding a case for this

getGetter PG.UUID = convertPV PersistText

but this produces another error, this time in postgresql-simple:

Incompatible {errSQLType = "uuid", errSQLTableOid = Nothing, errSQLField = "", errHaskellType = "Text", errMessage = "types incompatible"}

except for adding the case to getGetter, what needs to be changed and in which package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions