snaplet-sqlite-simple 1.0.0.1 → 1.0.0.2
raw patch · 2 files changed
+13/−4 lines, 2 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Snap.Snaplet.Auth.Backends.SqliteSimple: mkSqliteAuthMgr :: Text -> MVar Connection -> SqliteAuthManager
Files
snaplet-sqlite-simple.cabal view
@@ -1,5 +1,5 @@ name: snaplet-sqlite-simple-version: 1.0.0.1+version: 1.0.0.2 synopsis: sqlite-simple snaplet for the Snap Framework description: This snaplet provides support for using the SQLite database with a Snap Framework application via the
src/Snap/Snaplet/Auth/Backends/SqliteSimple.hs view
@@ -36,6 +36,7 @@ module Snap.Snaplet.Auth.Backends.SqliteSimple ( initSqliteAuth+ , mkSqliteAuthMgr ) where ------------------------------------------------------------------------------@@ -85,9 +86,8 @@ authTable <- liftIO $ C.lookupDefault "snap_auth_user" config "authTable" authSettings <- authSettingsFromConfig key <- liftIO $ getKey (asSiteKey authSettings)- let tableDesc = defAuthTable { tblName = authTable }- let manager = SqliteAuthManager tableDesc $- sqliteConn $ db ^# snapletValue+ let manager = mkSqliteAuthMgr authTable $+ sqliteConn $ db ^# snapletValue liftIO $ createTableIfMissing manager rng <- liftIO mkRNG return AuthManager@@ -105,6 +105,15 @@ where desc = "An Sqlite backend for user authentication" datadir = Just $ liftM (++"/resources/auth") getDataDir++------------------------------------------------------------------------------+-- | Construct sqlite-simple auth manager+--+-- Can be used in command line tools+mkSqliteAuthMgr :: T.Text -> MVar S.Connection -> SqliteAuthManager+mkSqliteAuthMgr name conn = SqliteAuthManager tableDesc conn+ where+ tableDesc = defAuthTable { tblName = name } tableExists :: S.Connection -> T.Text -> IO Bool