lpsmith / postgresql-simple

Mid-level client library for accessing PostgreSQL from Haskell
Other
206 stars 71 forks source link

FromField instance for Case Insensitive Text / citext support #231

Closed MaxGabriel closed 6 years ago

MaxGabriel commented 6 years ago

Hi, I was looking into citext support for persistent recently, and noticed that postgresql-simple had FromField instances for CI ST.Text and CI LT.Text, but not matching ToField instances. Is there any reason for this, and if not would you like me to add those two instances?

I also saw that citext wasn't in the generated src/Database/PostgreSQL/Simple/TypeInfo/Static.hs file. Would you like me to add it there by modifying tools/GenTypeInfo.hs?

I already have everything working without making any changes to postgresql-simple, I just thought this might be a welcome contribution so thought I'd ask.

Possibly related? #130

lpsmith commented 6 years ago

I don't think there is a reason for this; it seems like a simple oversight to me. (Though one easy to work around in any case.). I would probably merge a pull request. We may want to revisit the comments on commit bcbacfe9f2184692c5426ab9f6b89a2c4c4752b0 though.

lpsmith commented 6 years ago

Hmm, if I had things to do over again, I would have ByteString correspond to bytea, so maybe I am not so terribly excited about the comments on bcbacfe9f2184692c5426ab9f6b89a2c4c4752b0