doobie.free

statement

object statement

Algebra and free monad for primitive operations over a java.sql.Statement. This is a low-level API that exposes lifecycle-managed JDBC objects directly and is intended mainly for library developers. End users will prefer a safer, higher-level API such as that provided in the doobie.hi package.

StatementIO is a free monad that must be run via an interpreter, most commonly via natural transformation of its underlying algebra StatementOp to another monad via Free#foldMap.

The library provides a natural transformation to Kleisli[M, Statement, A] for any exception-trapping (Catchable) and effect-capturing (Capture) monad M. Such evidence is provided for Task, IO, and stdlib Future; and transK[M] is provided as syntax.

// An action to run
val a: StatementIO[Foo] = ...

// A JDBC object
val s: Statement = ...

// Unfolding into a Task
val ta: Task[A] = a.transK[Task].run(s)
Source
statement.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By inheritance
Inherited
  1. statement
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type StatementIO[A] = Free[StatementOp, A]

    Free monad over a free functor of StatementOp; abstractly, a computation that consumes a java.sql.Statement and produces a value of type A.

  2. implicit class StatementIOOps[A] extends AnyRef

    Syntax for StatementIO.

  3. sealed trait StatementOp[A] extends AnyRef

    Sum type of primitive operations over a java.sql.Statement.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. implicit val CaptureStatementIO: Capture[StatementIO]

    Capture instance for StatementIO.

  7. implicit val CatchableStatementIO: Catchable[StatementIO]

    Catchable instance for StatementIO.

  8. object StatementOp

    Module of constructors for StatementOp.

  9. def addBatch(a: String): StatementIO[Unit]

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def attempt[A](a: StatementIO[A]): StatementIO[\/[Throwable, A]]

    Lift a StatementIO[A] into an exception-capturing StatementIO[Throwable \/ A].

  12. val cancel: StatementIO[Unit]

  13. val clearBatch: StatementIO[Unit]

  14. val clearWarnings: StatementIO[Unit]

  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. val close: StatementIO[Unit]

  17. val closeOnCompletion: StatementIO[Unit]

  18. def delay[A](a: ⇒ A): StatementIO[A]

    Non-strict unit for capturing effects.

  19. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  21. def execute(a: String, b: Array[String]): StatementIO[Boolean]

  22. def execute(a: String): StatementIO[Boolean]

  23. def execute(a: String, b: Int): StatementIO[Boolean]

  24. def execute(a: String, b: Array[Int]): StatementIO[Boolean]

  25. val executeBatch: StatementIO[Array[Int]]

  26. def executeQuery(a: String): StatementIO[ResultSet]

  27. def executeUpdate(a: String, b: Int): StatementIO[Int]

  28. def executeUpdate(a: String, b: Array[Int]): StatementIO[Int]

  29. def executeUpdate(a: String, b: Array[String]): StatementIO[Int]

  30. def executeUpdate(a: String): StatementIO[Int]

  31. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  33. val getConnection: StatementIO[Connection]

  34. val getFetchDirection: StatementIO[Int]

  35. val getFetchSize: StatementIO[Int]

  36. val getGeneratedKeys: StatementIO[ResultSet]

  37. val getMaxFieldSize: StatementIO[Int]

  38. val getMaxRows: StatementIO[Int]

  39. def getMoreResults(a: Int): StatementIO[Boolean]

  40. val getMoreResults: StatementIO[Boolean]

  41. val getQueryTimeout: StatementIO[Int]

  42. val getResultSet: StatementIO[ResultSet]

  43. val getResultSetConcurrency: StatementIO[Int]

  44. val getResultSetHoldability: StatementIO[Int]

  45. val getResultSetType: StatementIO[Int]

  46. val getUpdateCount: StatementIO[Int]

  47. val getWarnings: StatementIO[SQLWarning]

  48. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  49. def interpK[M[_]](implicit arg0: Monad[M], arg1: Catchable[M], arg2: Capture[M]): ~>[StatementOp, [γ]Kleisli[M, Statement, γ]]

    Natural transformation from StatementOp to Kleisli for the given M, consuming a java.sql.Statement.

  50. val isCloseOnCompletion: StatementIO[Boolean]

  51. val isClosed: StatementIO[Boolean]

  52. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  53. val isPoolable: StatementIO[Boolean]

  54. def isWrapperFor(a: Class[_]): StatementIO[Boolean]

  55. def lift[Op[_], A, J](j: J, action: Free[Op, A])(implicit mod: Aux[Op, J]): StatementIO[A]

    Lift a different type of program that has a default Kleisli interpreter.

  56. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  57. final def notify(): Unit

    Definition Classes
    AnyRef
  58. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  59. def raw[A](f: (Statement) ⇒ A): StatementIO[A]

    Backdoor for arbitrary computations on the underlying Statement.

  60. def setCursorName(a: String): StatementIO[Unit]

  61. def setEscapeProcessing(a: Boolean): StatementIO[Unit]

  62. def setFetchDirection(a: Int): StatementIO[Unit]

  63. def setFetchSize(a: Int): StatementIO[Unit]

  64. def setMaxFieldSize(a: Int): StatementIO[Unit]

  65. def setMaxRows(a: Int): StatementIO[Unit]

  66. def setPoolable(a: Boolean): StatementIO[Unit]

  67. def setQueryTimeout(a: Int): StatementIO[Unit]

  68. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  69. def toString(): String

    Definition Classes
    AnyRef → Any
  70. def trans[M[_]](c: Statement)(implicit arg0: Monad[M], arg1: Catchable[M], arg2: Capture[M]): ~>[StatementIO, M]

    Natural transformation from StatementIO to M, given a java.sql.Statement.

  71. def transK[M[_]](implicit arg0: Monad[M], arg1: Catchable[M], arg2: Capture[M]): ~>[StatementIO, [γ]Kleisli[M, Statement, γ]]

    Natural transformation from StatementIO to Kleisli for the given M, consuming a java.sql.Statement.

  72. def unwrap[T](a: Class[T]): StatementIO[T]

  73. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Algebra

Constructors (Lifting)

Constructors (Primitives)

Typeclass Instances

Ungrouped