doobie.free

connection

object connection

Algebra and free monad for primitive operations over a java.sql.Connection. 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.

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

The library provides a natural transformation to Kleisli[M, Connection, 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: ConnectionIO[Foo] = ...

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

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

Type Members

  1. type ConnectionIO[A] = Free[ConnectionOp, A]

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

  2. implicit class ConnectionIOOps[A] extends AnyRef

    Syntax for ConnectionIO.

  3. sealed trait ConnectionOp[A] extends AnyRef

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

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 CaptureConnectionIO: Capture[ConnectionIO]

    Capture instance for ConnectionIO.

  7. implicit val CatchableConnectionIO: Catchable[ConnectionIO]

    Catchable instance for ConnectionIO.

  8. object ConnectionOp

    Module of constructors for ConnectionOp.

  9. def abort(a: Executor): ConnectionIO[Unit]

  10. final def asInstanceOf[T0]: T0

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

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

  12. val clearWarnings: ConnectionIO[Unit]

  13. def clone(): AnyRef

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

  15. val commit: ConnectionIO[Unit]

  16. def createArrayOf(a: String, b: Array[AnyRef]): ConnectionIO[Array]

  17. val createBlob: ConnectionIO[Blob]

  18. val createClob: ConnectionIO[Clob]

  19. val createNClob: ConnectionIO[NClob]

  20. val createSQLXML: ConnectionIO[SQLXML]

  21. def createStatement(a: Int, b: Int, c: Int): ConnectionIO[Statement]

  22. def createStatement(a: Int, b: Int): ConnectionIO[Statement]

  23. val createStatement: ConnectionIO[Statement]

  24. def createStruct(a: String, b: Array[AnyRef]): ConnectionIO[Struct]

  25. def delay[A](a: ⇒ A): ConnectionIO[A]

    Non-strict unit for capturing effects.

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

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

    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. val getAutoCommit: ConnectionIO[Boolean]

  30. val getCatalog: ConnectionIO[String]

  31. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  32. def getClientInfo(a: String): ConnectionIO[String]

  33. val getClientInfo: ConnectionIO[Properties]

  34. val getHoldability: ConnectionIO[Int]

  35. val getMetaData: ConnectionIO[DatabaseMetaData]

  36. val getNetworkTimeout: ConnectionIO[Int]

  37. val getSchema: ConnectionIO[String]

  38. val getTransactionIsolation: ConnectionIO[Int]

  39. val getTypeMap: ConnectionIO[Map[String, Class[_]]]

  40. val getWarnings: ConnectionIO[SQLWarning]

  41. def hashCode(): Int

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

    Natural transformation from ConnectionOp to Kleisli for the given M, consuming a java.sql.Connection.

  43. val isClosed: ConnectionIO[Boolean]

  44. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  45. val isReadOnly: ConnectionIO[Boolean]

  46. def isValid(a: Int): ConnectionIO[Boolean]

  47. def isWrapperFor(a: Class[_]): ConnectionIO[Boolean]

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

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

  49. def nativeSQL(a: String): ConnectionIO[String]

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

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

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

    Definition Classes
    AnyRef
  53. def prepareCall(a: String): ConnectionIO[CallableStatement]

  54. def prepareCall(a: String, b: Int, c: Int): ConnectionIO[CallableStatement]

  55. def prepareCall(a: String, b: Int, c: Int, d: Int): ConnectionIO[CallableStatement]

  56. def prepareStatement(a: String, b: Int, c: Int): ConnectionIO[PreparedStatement]

  57. def prepareStatement(a: String): ConnectionIO[PreparedStatement]

  58. def prepareStatement(a: String, b: Array[String]): ConnectionIO[PreparedStatement]

  59. def prepareStatement(a: String, b: Array[Int]): ConnectionIO[PreparedStatement]

  60. def prepareStatement(a: String, b: Int, c: Int, d: Int): ConnectionIO[PreparedStatement]

  61. def prepareStatement(a: String, b: Int): ConnectionIO[PreparedStatement]

  62. def raw[A](f: (Connection) ⇒ A): ConnectionIO[A]

    Backdoor for arbitrary computations on the underlying Connection.

  63. def releaseSavepoint(a: Savepoint): ConnectionIO[Unit]

  64. def rollback(a: Savepoint): ConnectionIO[Unit]

  65. val rollback: ConnectionIO[Unit]

  66. def setAutoCommit(a: Boolean): ConnectionIO[Unit]

  67. def setCatalog(a: String): ConnectionIO[Unit]

  68. def setClientInfo(a: String, b: String): ConnectionIO[Unit]

  69. def setClientInfo(a: Properties): ConnectionIO[Unit]

  70. def setHoldability(a: Int): ConnectionIO[Unit]

  71. def setNetworkTimeout(a: Executor, b: Int): ConnectionIO[Unit]

  72. def setReadOnly(a: Boolean): ConnectionIO[Unit]

  73. def setSavepoint(a: String): ConnectionIO[Savepoint]

  74. val setSavepoint: ConnectionIO[Savepoint]

  75. def setSchema(a: String): ConnectionIO[Unit]

  76. def setTransactionIsolation(a: Int): ConnectionIO[Unit]

  77. def setTypeMap(a: Map[String, Class[_]]): ConnectionIO[Unit]

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

    Definition Classes
    AnyRef
  79. def toString(): String

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

    Natural transformation from ConnectionIO to M, given a java.sql.Connection.

  81. def transK[M[_]](implicit arg0: Monad[M], arg1: Catchable[M], arg2: Capture[M]): ~>[ConnectionIO, [γ]Kleisli[M, Connection, γ]]

    Natural transformation from ConnectionIO to Kleisli for the given M, consuming a java.sql.Connection.

  82. def unwrap[T](a: Class[T]): ConnectionIO[T]

  83. final def wait(): Unit

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  85. 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