3

Please forgive how simple this question is.

Google searches, the documentation, and the Yesod book seem to only explain how to do things with databases, but I have yet to see a straight forward explanation on how to actually connect to one.

Any help or guidance in the right direction would be appreciated.

Edit: I simplified the code sample from the Yesod book to make it a little easier to read and use.

subtlearray
  • 1,251
  • 1
  • 11
  • 23

1 Answers1

4

The "Home Page" of the persistent package has an example showing how to connect to an in-memory instance of sqlite:

http://www.yesodweb.com/book/persistent

Seems that all you would have to change is the withSqliteConn call.

ErikR
  • 51,541
  • 9
  • 73
  • 124
  • I see. So withSqliteConn is like connectSqlite3 from HDBC (Database.HDBC.Sqlite3). It makes sense now. Thank you. – subtlearray Nov 25 '12 at 16:36