
Are there any persistent-mysql examples ? I can't get anything from http://www.yesodweb.com/book/persistent to compile, let alone with mysql.

Have you tried the Yesod scaffold? It does have the option of using MySQL as a backend. Cheers, -- Felipe.

On Fri, Aug 24, 2012 at 12:31 AM, Asafe Ribeiro
No, i'm not using yesod, only persistent. Or is that not possible?
Yes, it is possible, just not usual =). That's probably why the examples are outdated. I don't have time right now to write a simple example, but you may take a look at persistent-test [1], which is persistent's test suite (and completely independent of Yesod). In particular, take a look at runConn [2]. And please do bring any further questions you get along the way =). Cheers, [1] https://github.com/yesodweb/persistent/tree/master/persistent-test [2] https://github.com/yesodweb/persistent/blob/master/persistent-test/Init.hs#L... -- Felipe.

By the way , is there a way to persistent map all table to sum types
like e.g. linq to slq does?
On Fri, Aug 24, 2012 at 7:58 AM, Felipe Almeida Lessa
On Fri, Aug 24, 2012 at 12:31 AM, Asafe Ribeiro
wrote: No, i'm not using yesod, only persistent. Or is that not possible?
Yes, it is possible, just not usual =). That's probably why the examples are outdated.
I don't have time right now to write a simple example, but you may take a look at persistent-test [1], which is persistent's test suite (and completely independent of Yesod). In particular, take a look at runConn [2]. And please do bring any further questions you get along the way =).
Cheers,
[1] https://github.com/yesodweb/persistent/tree/master/persistent-test [2] https://github.com/yesodweb/persistent/blob/master/persistent-test/Init.hs#L...
-- Felipe.

And if I understand correctly by reading the section Closer look at
types at the tutorial I can't have a pk with type other than Int ?
On Fri, Aug 24, 2012 at 10:08 PM, Asafe Ribeiro
By the way , is there a way to persistent map all table to sum types like e.g. linq to slq does?
On Fri, Aug 24, 2012 at 7:58 AM, Felipe Almeida Lessa
wrote: On Fri, Aug 24, 2012 at 12:31 AM, Asafe Ribeiro
wrote: No, i'm not using yesod, only persistent. Or is that not possible?
Yes, it is possible, just not usual =). That's probably why the examples are outdated.
I don't have time right now to write a simple example, but you may take a look at persistent-test [1], which is persistent's test suite (and completely independent of Yesod). In particular, take a look at runConn [2]. And please do bring any further questions you get along the way =).
Cheers,
[1] https://github.com/yesodweb/persistent/tree/master/persistent-test [2] https://github.com/yesodweb/persistent/blob/master/persistent-test/Init.hs#L...
-- Felipe.
participants (2)
-
Asafe Ribeiro
-
Felipe Almeida Lessa