Created
September 14, 2009 15:05
-
-
Save sordina/186706 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Database.HDBC | |
import Database.HDBC.Sqlite3 | |
import qualified Data.Convertible.Base as C | |
get :: forall a. C.Convertible SqlValue a => [[SqlValue]] -> [[a]] | |
get sql = map f sql | |
where f row = map fromSql row | |
main = do | |
connection <- connectSqlite3 "development.sqlite3" | |
result <- quickQuery connection "SELECT * from cards where id < 10" [] | |
print result | |
disconnect connection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment