Object

doobie.free

statement

Related Doc: package free

Permalink

object statement extends StatementIOInstances

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
StatementIOInstances, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. statement
  2. StatementIOInstances
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

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

    Permalink

    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

    Permalink

    Syntax for StatementIO.

  3. sealed trait StatementOp[A] extends AnyRef

    Permalink

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

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. implicit val CaptureStatementIO: Capture[StatementIO]

    Permalink

    Capture instance for StatementIO.

  5. implicit val CatchableStatementIO: Catchable[StatementIO]

    Permalink

    Catchable instance for StatementIO.

  6. object StatementOp

    Permalink

    Module of constructors for StatementOp.

    Module of constructors for StatementOp. These are rarely useful outside of the implementation; prefer the smart constructors provided by the statement module.

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

    Permalink

  8. final def asInstanceOf[T0]: T0

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

    Permalink

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

  10. val cancel: StatementIO[Unit]

    Permalink

  11. val clearBatch: StatementIO[Unit]

    Permalink

  12. val clearWarnings: StatementIO[Unit]

    Permalink

  13. def clone(): AnyRef

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

    Permalink

  15. val closeOnCompletion: StatementIO[Unit]

    Permalink

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

    Permalink

    Non-strict unit for capturing effects.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  19. def execute(a: String, b: Int): StatementIO[Boolean]

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

  24. val executeLargeBatch: StatementIO[Array[Long]]

    Permalink

  25. def executeLargeUpdate(a: String, b: Int): StatementIO[Long]

    Permalink

  26. def executeLargeUpdate(a: String, b: Array[String]): StatementIO[Long]

    Permalink

  27. def executeLargeUpdate(a: String, b: Array[Int]): StatementIO[Long]

    Permalink

  28. def executeLargeUpdate(a: String): StatementIO[Long]

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

  34. def finalize(): Unit

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

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

    Permalink

  37. val getFetchDirection: StatementIO[Int]

    Permalink

  38. val getFetchSize: StatementIO[Int]

    Permalink

  39. val getGeneratedKeys: StatementIO[ResultSet]

    Permalink

  40. val getLargeMaxRows: StatementIO[Long]

    Permalink

  41. val getLargeUpdateCount: StatementIO[Long]

    Permalink

  42. val getMaxFieldSize: StatementIO[Int]

    Permalink

  43. val getMaxRows: StatementIO[Int]

    Permalink

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

    Permalink

  45. val getMoreResults: StatementIO[Boolean]

    Permalink

  46. val getQueryTimeout: StatementIO[Int]

    Permalink

  47. val getResultSet: StatementIO[ResultSet]

    Permalink

  48. val getResultSetConcurrency: StatementIO[Int]

    Permalink

  49. val getResultSetHoldability: StatementIO[Int]

    Permalink

  50. val getResultSetType: StatementIO[Int]

    Permalink

  51. val getUpdateCount: StatementIO[Int]

    Permalink

  52. val getWarnings: StatementIO[SQLWarning]

    Permalink

  53. def hashCode(): Int

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

    Permalink

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

  55. val isCloseOnCompletion: StatementIO[Boolean]

    Permalink

  56. val isClosed: StatementIO[Boolean]

    Permalink

  57. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  58. val isPoolable: StatementIO[Boolean]

    Permalink

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

    Permalink

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  62. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  63. final def notifyAll(): Unit

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

    Permalink

    Backdoor for arbitrary computations on the underlying Statement.

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

  69. def setLargeMaxRows(a: Long): StatementIO[Unit]

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink

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

    Permalink
    Definition Classes
    AnyRef
  75. def toString(): String

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

    Permalink

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

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

    Permalink

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

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

    Permalink

  79. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StatementIOInstances

Inherited from AnyRef

Inherited from Any

Algebra

Constructors (Lifting)

Constructors (Primitives)

Typeclass Instances

Ungrouped