packages feed

hasql-2.2.0.0 / src / library-tests / Integration / Sharing / Decoders / Float8Spec.hs

module Integration.Sharing.Decoders.Float8Spec (spec) whereimport Hasql.Connection qualified as Connectionimport Hasql.Decoders qualified as Decodersimport Hasql.Session qualified as Sessionimport Hasql.Statement qualified as Statementimport Helpers.Scripts qualified as Scriptsimport Preludeimport Test.Hspecspec :: SpecWith Scripts.ScopeParamsspec = do  it "decodes static value properly" \config -> do    Scripts.onPreparableConnection config \connection -> do      let statement =            Statement.preparable              "select 3.14 :: float8"              mempty              ( Decoders.singleRow                  ( Decoders.column                      ( Decoders.nonNullable                          Decoders.float8                      )                  )              )      result <- Connection.use connection (Session.statement () statement)      result `shouldBe` Right 3.14