Skip to content

Commit

Permalink
Add a note of @snoyberg's comment at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Sep 27, 2016
1 parent 5788981 commit 9b4a7a1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cookbook/custom-datatype-columns.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Custom data types column in Persistent
===============================================

*NOTE: This article just demonstrates how to use this technique. But
in actual practice you should probably store each value in
MyCustomTuple as an individual column. This is what Michael Snoyman
had to say on this: "It's bad from a DB management standpoint: it's
just storing the data as JSON in the table, which is difficult to work
with. The proper where is to just have two different fields in the
entity. Whether you want to do it one way or the other though is up to
personal preference, both work." See
[here](https://github.com/yesodweb/yesod-cookbook/pull/11#issuecomment-247297565)
for more information.*

Let's say you have a custom datatype like

``` haskell
Expand Down

0 comments on commit 9b4a7a1

Please sign in to comment.