Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to an Sqlite3 database with Haskell / Persistent

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.

like image 347
subtlearray Avatar asked Jul 11 '26 11:07

subtlearray


1 Answers

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.

like image 78
ErikR Avatar answered Jul 13 '26 16:07

ErikR



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!