Skip to content

Commit

Permalink
multi-statement with extended protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
tpolecat committed Jul 12, 2020
1 parent 71e560d commit be5cfcc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/tests/src/test/scala/MultipleStatementsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import skunk._
import skunk.implicits._
import skunk.codec.all._
import skunk.exception.SkunkException
import cats.effect.IO
import skunk.exception.PostgresErrorException

object MultipleStatementsTest extends SkunkTest {

Expand All @@ -24,4 +26,16 @@ object MultipleStatementsTest extends SkunkTest {
sessionTest(s"command: ${c.sql}") { s => s.execute(c).assertFailsWith[SkunkException] *> s.assertHealthy }
}

sessionTest("extended query (postgres raises an error here)") { s =>
s.prepare(sql"select 1;commit".query(int4))
.use(_ => IO.unit)
.assertFailsWith[PostgresErrorException] *> s.assertHealthy
}

sessionTest("extended command (postgres raises an error here)") { s =>
s.prepare(sql"select 1;commit".command)
.use(_ => IO.unit)
.assertFailsWith[PostgresErrorException] *> s.assertHealthy
}

}

0 comments on commit be5cfcc

Please sign in to comment.