[web-devel] (Yesod) PersistEntity Key types

Rick Richardson rick.richardson at gmail.com
Sun Apr 3 00:57:43 CEST 2011

I ran into another snag getting the tests running for MongoDB backend.  The
PersistEntity class, and, it appears, the TH is hardcoded to set the key
type as Int64.

This is a problem since the key type in MongoDB is a 12 byte blob.

The other problem is that it looks like PersistBackends are pretty much
hardcoded to that type as well.  I guess the correct approach would be to
allow the designation in mkPersist and then ensure that the PersistBackends
can parametrically deal with differing  Key types.  Or, in the case of
MongoDB, hardcode it to a 12 byte blob, because other key types (ObjectId's)
rarely make sense.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/web-devel/attachments/20110402/bc7fd31d/attachment.htm>

More information about the web-devel mailing list