packages feed

snaplet-postgresql-simple 0.1.1 → 0.2

raw patch · 3 files changed

+18/−12 lines, 3 filesdep ~postgresql-simple

Dependency ranges changed: postgresql-simple

Files

snaplet-postgresql-simple.cabal view
@@ -1,5 +1,5 @@ name:           snaplet-postgresql-simple-version:        0.1.1+version:        0.2 synopsis:       postgresql-simple snaplet for the Snap Framework description:    This snaplet contains support for using the Postgresql                 database with a Snap Framework application via the@@ -41,7 +41,7 @@     configurator               >= 0.2     && < 0.3,     MonadCatchIO-transformers  >= 0.3     && < 0.4,     mtl                        >= 2       && < 3,-    postgresql-simple          >= 0.1     && < 0.3,+    postgresql-simple          >= 0.2     && < 0.3,     resource-pool-catchio      >= 0.2     && < 0.3,     snap                       >= 0.9     && < 0.10,     text                       >= 0.11    && < 0.12,
src/Snap/Snaplet/Auth/Backends/PostgresqlSimple.hs view
@@ -210,18 +210,18 @@   ,  colId               = ("uid", "SERIAL PRIMARY KEY")   ,  colLogin            = ("login", "text UNIQUE NOT NULL")   ,  colPassword         = ("password", "text")-  ,  colActivatedAt      = ("activated_at", "timestamp")-  ,  colSuspendedAt      = ("suspended_at", "timestamp")+  ,  colActivatedAt      = ("activated_at", "timestamptz")+  ,  colSuspendedAt      = ("suspended_at", "timestamptz")   ,  colRememberToken    = ("remember_token", "text")   ,  colLoginCount       = ("login_count", "integer NOT NULL")   ,  colFailedLoginCount = ("failed_login_count", "integer NOT NULL")-  ,  colLockedOutUntil   = ("locked_out_until", "timestamp")-  ,  colCurrentLoginAt   = ("current_login_at", "timestamp")-  ,  colLastLoginAt      = ("last_login_at", "timestamp")+  ,  colLockedOutUntil   = ("locked_out_until", "timestamptz")+  ,  colCurrentLoginAt   = ("current_login_at", "timestamptz")+  ,  colLastLoginAt      = ("last_login_at", "timestamptz")   ,  colCurrentLoginIp   = ("current_login_ip", "text")   ,  colLastLoginIp      = ("last_login_ip", "text")-  ,  colCreatedAt        = ("created_at", "timestamp")-  ,  colUpdatedAt        = ("updated_at", "timestamp")+  ,  colCreatedAt        = ("created_at", "timestamptz")+  ,  colUpdatedAt        = ("updated_at", "timestamptz")   ,  rolesTable          = "user_roles"   } 
src/Snap/Snaplet/PostgresqlSimple.hs view
@@ -157,14 +157,20 @@   --------------------------------------------------------------------------------- | A convenience instance to make it easier to use this snaplet in monads--- other than Handler.  It allows you to get database access in initializers--- like this:+-- | A convenience instance to make it easier to use this snaplet in the+-- Initializer monad like this: -- -- > d <- nestSnaplet "db" db pgsInit -- > count <- liftIO $ runReaderT (execute "INSERT ..." params) d instance (MonadCatchIO m) => HasPostgres (ReaderT (Snaplet Postgres) m) where     getPostgresState = asks (getL snapletValue)+++------------------------------------------------------------------------------+-- | A convenience instance to make it easier to use functions written for+-- this snaplet in non-snaplet contexts.+instance (MonadCatchIO m) => HasPostgres (ReaderT Postgres m) where+    getPostgresState = ask   ------------------------------------------------------------------------------