snaplet-sqlite-simple 0.4.5 → 0.4.6
raw patch · 2 files changed
+14/−9 lines, 2 filesdep ~aesondep ~snapdep ~text
Dependency ranges changed: aeson, snap, text, transformers
Files
snaplet-sqlite-simple.cabal view
@@ -1,5 +1,5 @@ name: snaplet-sqlite-simple-version: 0.4.5+version: 0.4.6 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@@ -47,7 +47,7 @@ Paths_snaplet_sqlite_simple build-depends:- aeson >= 0.6 && < 0.7,+ aeson >= 0.6 && < 0.8, base >= 4 && < 5, bytestring >= 0.9.1 && < 0.11, clientsession >= 0.8 && < 0.10,@@ -56,9 +56,9 @@ mtl >= 2 && < 3, sqlite-simple >= 0.4.1 && < 1.0, direct-sqlite >= 2.3.3 && < 2.4,- snap >= 0.10 && < 0.14,- text >= 0.11 && < 0.12,- transformers >= 0.2 && < 0.4,+ snap >= 0.13 && < 0.14,+ text >= 0.11 && < 1.2,+ transformers >= 0.3 && < 0.4, unordered-containers >= 0.2 && < 0.3 @@ -77,7 +77,7 @@ , SafeCWD build-depends:- aeson >= 0.6 && < 0.7,+ aeson, HUnit >= 1.2 && < 2, MonadCatchIO-transformers >= 0.2 && < 0.4, base >= 4 && < 5,@@ -96,9 +96,9 @@ stm >= 2.4, test-framework >= 0.6 && < 0.9, test-framework-hunit >= 0.2.7 && < 0.4,- text >= 0.11 && < 0.12,+ text >= 0.11 && < 1.2, time >= 1.1,- transformers >= 0.2,+ transformers >= 0.3 && < 0.4, unordered-containers >= 0.2 && < 0.3 default-extensions:
src/Snap/Snaplet/Auth/Backends/SqliteSimple.hs view
@@ -46,6 +46,7 @@ import Data.Maybe import Data.Text (Text) import qualified Data.Text as T+import qualified Data.Text.Encoding as T import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.Encoding as LT import qualified Database.SQLite.Simple as S@@ -241,9 +242,13 @@ meta <- fmap (fmap (fromMaybe HM.empty . A.decode' . LT.encodeUtf8)) _userMeta return $ fromMaybe HM.empty meta + -- NOTE I think the T/LT.encudeUtf8 will break if the Roles+ -- list contains strings that are not valid UTF-8. It's+ -- probably never the case, though. In my defense, this is a+ -- rarely used feature, and somewhat deprecated in Snap. textDecodeBS :: Maybe LT.Text -> Maybe [ByteString] textDecodeBS Nothing = Nothing- textDecodeBS (Just t) = A.decode' . LT.encodeUtf8 $ t+ textDecodeBS (Just t) = fmap (map T.encodeUtf8) . A.decode' . LT.encodeUtf8 $ t querySingle :: (ToRow q, FromRow a)