Has anyone done nested comments in IHP in a clean-ish way yet?
I get the feeling that comment_id
/ parent_id
inside the comments table is not a a good idea, but would be nice if I could just do that :)
I'm a bit skeptical to nested sets, but seems like the most popular answer on stack overflow
Having a parent_id
is the way to go IMO :)
I'm very new to Haskell, but if you're able to use JSON in your view this recursive CTE can give you a nice tree structure to work with.
https://gist.github.com/Manborough/669abb4c095fe092c564b73e9c4ed159
It's been a long time since I worked with it/understood exactly how it functions, but I have found it useful in the past.