· 6 years ago · Oct 30, 2019, 05:50 AM
1initDB
2 :: FilePath
3 -> IO ( Either SQLiteResponse FirstAppDB )
4initDB fp =
5 Sql.runDBAction $
6 Sql.open fp >>= (\conn -> const (pure $ FirstAppDB conn) (Sql.execute_ conn createTableQ))
7 where
8 createTableQ = "CREATE TABLE IF NOT EXISTS comments (id INTEGER PRIMARY KEY, topic TEXT, comment TEXT, time TEXT)"