Connector

jdbc.connector.Connector
object Connector

Attributes

Source
Connector.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Connector.type

Members list

Type members

Classlikes

class Driver[F[_]](using ev: Async[F])

Attributes

Source
Connector.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def fromConnection[F[_] : Sync](connection: Connection | Connection[F], logHandler: Option[LogHandler[F]]): Connector[F]

Construct a DataSource that wraps an existing Connection. Closing the connection is the responsibility of the caller.

Construct a DataSource that wraps an existing Connection. Closing the connection is the responsibility of the caller.

Value parameters

connection

a raw JDBC Connection to wrap

Attributes

Source
Connector.scala
def fromConnection[F[_] : Sync](connection: Connection[F]): Connector[F]

Attributes

Source
Connector.scala
def fromDataSource[F[_] : Async](dataSource: DataSource, connectEC: ExecutionContext, logHandler: Option[LogHandler[F]]): Connector[F]

Construct a constructor of Connector[F] for some D <: DataSource When calling this constructor you should explicitly supply the effect type M e.g. ConnectionProvider.fromDataSource[IO](myDataSource, connectEC)

Construct a constructor of Connector[F] for some D <: DataSource When calling this constructor you should explicitly supply the effect type M e.g. ConnectionProvider.fromDataSource[IO](myDataSource, connectEC)

Value parameters

connectEC

Execution context dedicated to database connection.

dataSource

A data source that manages connection information to MySQL.

Attributes

Source
Connector.scala
def fromDriverManager[F[_] : Async]: Driver[F]

Module of constructors for Connector that use the JDBC DriverManager to allocate connections. Note that DriverManager is unbounded and will happily allocate new connections until server resources are exhausted. It is usually preferable to use DataSourceTransactor with an underlying bounded connection pool. Blocking operations on DriverProvider are executed on an unbounded cached daemon thread pool by default, so you are also at risk of exhausting system threads. TL;DR this is fine for console apps but don't use it for a web application.

Module of constructors for Connector that use the JDBC DriverManager to allocate connections. Note that DriverManager is unbounded and will happily allocate new connections until server resources are exhausted. It is usually preferable to use DataSourceTransactor with an underlying bounded connection pool. Blocking operations on DriverProvider are executed on an unbounded cached daemon thread pool by default, so you are also at risk of exhausting system threads. TL;DR this is fine for console apps but don't use it for a web application.

Attributes

Source
Connector.scala