Skip to content

Instantly share code, notes, and snippets.

@sordina
Created September 14, 2009 15:05
Show Gist options
  • Save sordina/186706 to your computer and use it in GitHub Desktop.
Save sordina/186706 to your computer and use it in GitHub Desktop.
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