persistent 1.1.3.1 → 1.1.3.2
raw patch · 4 files changed
+11/−4 lines, 4 files
Files
- Database/Persist/GenericSql/Raw.hs +4/−3
- Database/Persist/Quasi.hs +1/−0
- Database/Persist/Store.hs +5/−0
- persistent.cabal +1/−1
Database/Persist/GenericSql/Raw.hs view
@@ -23,6 +23,7 @@ import Database.Persist.Store (PersistValue) import Data.IORef import Control.Monad.IO.Class+import Control.Monad.Logger (logDebugS) import Control.Monad.Trans.Reader import qualified Data.Map as Map import Control.Applicative (Applicative)@@ -31,7 +32,7 @@ import Control.Monad.Trans.Control (MonadBaseControl (..), ComposeSt, defaultLiftBaseWith, defaultRestoreM, MonadTransControl (..)) import Control.Monad (liftM) #define MBCIO MonadBaseControl IO-import Data.Text (Text)+import Data.Text (Text, pack) import Control.Monad (MonadPlus) import Control.Monad.Trans.Resource (MonadResource (..)) import Data.Conduit@@ -117,7 +118,7 @@ -> [PersistValue] -> Source m [PersistValue] withStmt sql vals = do- lift $ $logSQL sql vals+ lift $ $logDebugS (pack "SQL") $ pack $ show sql ++ " " ++ show vals conn <- lift askSqlConn bracketP (getStmt' conn sql)@@ -126,7 +127,7 @@ execute :: MonadSqlPersist m => Text -> [PersistValue] -> m () execute sql vals = do- $logSQL sql vals+ $logDebugS (pack "SQL") $ pack $ show sql ++ " " ++ show vals stmt <- getStmt sql liftIO $ I.execute stmt vals liftIO $ reset stmt
Database/Persist/Quasi.hs view
@@ -106,6 +106,7 @@ tokenize t | T.null t = [] | "--" `T.isPrefixOf` t = [] -- Comment until the end of the line.+ | "#" `T.isPrefixOf` t = [] -- Also comment to the end of the line, needed for a CPP bug (#110) | T.head t == '"' = quotes (T.tail t) id | T.head t == '(' = parens 1 (T.tail t) id | isSpace (T.head t) =
Database/Persist/Store.hs view
@@ -626,6 +626,11 @@ #undef GO #undef GOX +-- | Queries against unique keys (other than the id).+--+-- Please read the general Persistent documentation to learn how to create+-- Unique keys.+-- SQL backends automatically create uniqueness constraints, but for MongoDB you must place a unique index on the field. class PersistStore m => PersistUnique m where -- | Get a record by unique key, if available. Returns also the identifier. getBy :: (PersistEntityBackend val ~ PersistMonadBackend m, PersistEntity val) => Unique val -> m (Maybe (Entity val))
persistent.cabal view
@@ -1,5 +1,5 @@ name: persistent-version: 1.1.3.1+version: 1.1.3.2 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>