Persistent and foreign keys to SnapAuthUser

13 views
Skip to first unread message

Cody Goodman

unread,
Nov 27, 2014, 3:38:21 AM11/27/14
to snap_fr...@googlegroups.com
I'm just trying to insert some data that is keyed to the SnapAuthUser id of the currently logged in user. I'm getting an error and not quite sure how to debug it:

http://lpaste.net/5010286106214662144

Michael Snoyman

unread,
Nov 27, 2014, 10:29:52 AM11/27/14
to snap_fr...@googlegroups.com
What it's saying in more human terms is:

You're trying to insert something of type `SnapAuthUserId -> Dog` into the database, but I don't know how to store functions.

I'm not an expert on digestive functors, but I'm fairly certain the issue is that your dogForm only provides 3 of the 4 arguments for the Dog data constructor. If you apply `d` to a `SnapAuthUserId`, or do something equivalent in dogForm itself, it should work. But I'm not sure how to get the SnapAuthUserId for the currently logged in user, maybe someone else can help with that.

On Thu Nov 27 2014 at 5:24:02 PM Cody Goodman <codygman....@gmail.com> wrote:
I'm just trying to insert some data that is keyed to the SnapAuthUser id of the currently logged in user. I'm getting an error and not quite sure how to debug it:

http://lpaste.net/5010286106214662144

--

---
You received this message because you are subscribed to the Google Groups "Snap Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snap_framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MightyByte

unread,
Nov 27, 2014, 10:39:50 AM11/27/14
to snap_fr...@googlegroups.com
Cody,

Try something like this:

http://lpaste.net/5010286106214662144

Cody Goodman

unread,
Nov 27, 2014, 6:10:53 PM11/27/14
to snap_fr...@googlegroups.com
Thanks snoyberg and mightybyte. I'm actually having another issue now. I tried to debug it for the past few hours, but I guess I don't really get how snap works behind the scenes. There is a type error when trying to use the persisten-snaplet handler within "with auth". This problem didn't happen with postgresql simple. I'm guessing there is something else I have to do to the HasPersistPool instance. Embarassingly enough I've been trying to solve this for the past 4-5 hours and have run out of ideas. Here is the code+error:

http://lpaste.net/115228

I'm trying to figure out what I don't understand so I can learn it and fix these problems myself, if either of you (or anyone else) might see some obvious weak points in my knowledge please direct me to resources that can fix it.

Cody Goodman

unread,
Nov 28, 2014, 1:55:20 AM11/28/14
to snap_fr...@googlegroups.com
Oh, I needed withTop and I think I kind of understand why. Looks like i need to go understand MonadSnaplet more.
Reply all
Reply to author
Forward
0 new messages