{"action":"created","issue":{"url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/12","labels_url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/12/comments","events_url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/12/events","html_url":"https://github.com/nurpax/snaplet-sqlite-simple/issues/12","id":74498892,"number":12,"title":"Auto creation of database does not work","user":{"login":"JesperAxelsson","id":687960,"avatar_url":"https://avatars.githubusercontent.com/u/687960?v=3","gravatar_id":"","url":"https://api.github.com/users/JesperAxelsson","html_url":"https://github.com/JesperAxelsson","followers_url":"https://api.github.com/users/JesperAxelsson/followers","following_url":"https://api.github.com/users/JesperAxelsson/following{/other_user}","gists_url":"https://api.github.com/users/JesperAxelsson/gists{/gist_id}","starred_url":"https://api.github.com/users/JesperAxelsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JesperAxelsson/subscriptions","organizations_url":"https://api.github.com/users/JesperAxelsson/orgs","repos_url":"https://api.github.com/users/JesperAxelsson/repos","events_url":"https://api.github.com/users/JesperAxelsson/events{/privacy}","received_events_url":"https://api.github.com/users/JesperAxelsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-08T21:18:58Z","updated_at":"2015-05-10T09:38:54Z","closed_at":null,"body":"Hi!\r\nI tried using your snaplet and it doesn't seem to copy the cfg files correctly on windows. The folders is created but no files created. Tried it with your example app as well but no lock. \r\n\r\nAm I  missing a config file or something else?\r\n\r\nThis were installed in a sandbox I should note.\r\n\r\nError:\r\nInitializer threw an exception...\r\nMust specify db filename\r\n"},"comment":{"url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/comments/100614643","html_url":"https://github.com/nurpax/snaplet-sqlite-simple/issues/12#issuecomment-100614643","issue_url":"https://api.github.com/repos/nurpax/snaplet-sqlite-simple/issues/12","id":100614643,"user":{"login":"nurpax","id":297823,"avatar_url":"https://avatars.githubusercontent.com/u/297823?v=3","gravatar_id":"","url":"https://api.github.com/users/nurpax","html_url":"https://github.com/nurpax","followers_url":"https://api.github.com/users/nurpax/followers","following_url":"https://api.github.com/users/nurpax/following{/other_user}","gists_url":"https://api.github.com/users/nurpax/gists{/gist_id}","starred_url":"https://api.github.com/users/nurpax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nurpax/subscriptions","organizations_url":"https://api.github.com/users/nurpax/orgs","repos_url":"https://api.github.com/users/nurpax/repos","events_url":"https://api.github.com/users/nurpax/events{/privacy}","received_events_url":"https://api.github.com/users/nurpax/received_events","type":"User","site_admin":false},"created_at":"2015-05-10T09:38:53Z","updated_at":"2015-05-10T09:38:53Z","body":"```\r\nlet c = sqliteConn $ d ^# snapletValue\r\nliftIO $ withMVar c $ \\conn -> Model.createTables conn\r\n```\r\n\r\nThis is needed in order to create the database but it's not really required for snaplet init.  That's just if you want to do some db initialization on app load.  The error  \"Initializer threw an exception: Must specify db filename\" is orthogonal to this init code.\r\n\r\nIt could be the config file can't be found or it somehow fails to parse.  I have a couple of suggestions on how you could debug this further:\r\n\r\n 1. Try running the same code on Linux (e.g. create a Virtualbox VM for say Ubuntu)\r\n 2. Try adding some debug prints in the snaplet-sqlite-simple init code in https://github.com/nurpax/snaplet-sqlite-simple/blob/master/src/Snap/Snaplet/SqliteSimple.hs\r\n\r\nThe snaplet init code is as follows:\r\n\r\n```\r\n------------------------------------------------------------------------------\r\n-- | Initialize the snaplet\r\nsqliteInit :: SnapletInit b Sqlite\r\nsqliteInit = makeSnaplet \"sqlite-simple\" description datadir $ do\r\n    config <- getSnapletUserConfig\r\n    (mci,errs) <- runWriterT $\r\n        logErr \"Must specify db filename\" $ C.lookup config \"db\"\r\n    let ci = fromMaybe (error $ intercalate \"\\n\" errs) mci\r\n    tracing <- liftIO $ C.lookupDefault False config \"enableSqlTracing\"\r\n    conn <- liftIO (S.open ci >>= setTracing tracing >>= newMVar)\r\n    return $ Sqlite conn\r\n  where\r\n    description = \"Sqlite abstraction\"\r\n\r\n    datadir = Just $ liftM (++\"/resources/db\") getDataDir\r\n\r\n    setTracing tracing conn = do\r\n      when tracing (S.setTrace conn (Just (putStrLn . T.unpack)))\r\n      return conn\r\n```\r\n\r\nPerhaps print the values of \r\n"}}