packages feed

hsSqlite3-0.1: src/hs_sqlite3_test.hs

import Database.Sqlite3
import Database.Sqlite3.Middle
import Control.Monad.Trans

main = runSimpleDb $ do

  open "db"

  liftIO $ print "Start"

  tab :: [Nil :. Int :. Int :. Double] <- fetch "SELECT * FROM test01"
  liftIO $ mapM print tab

  bind "INSERT INTO test01 VALUES(?,?,?)" $
    replicate 7 $
      Nil :. (1::Int) :. (2::Int) :. (3.0::Double)

  close

  liftIO $ print "Finish"