ConnectionProvider

ldbc.connector.ConnectionProvider
See theConnectionProvider companion object
trait ConnectionProvider[F[_], A] extends Provider[F]

Attributes

Companion
object
Source
ConnectionProvider.scala
Graph
Supertypes
trait Provider[F]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def addSocketOption(socketOption: SocketOption): ConnectionProvider[F, A]

Update socket options for TCP/UDP sockets.

Update socket options for TCP/UDP sockets.

 ConnectionProvider
   ...
   .addSocketOption(SocketOption.noDelay(true))

Value parameters

socketOption

Socket options for TCP/UDP sockets

Attributes

Source
ConnectionProvider.scala

Create a connection managed by Resource.

Create a connection managed by Resource.

 provider.createConnection().user { connection =>
   ???
 }

Attributes

Source
ConnectionProvider.scala
def setAllowPublicKeyRetrieval(allowPublicKeyRetrieval: Boolean): ConnectionProvider[F, A]

Update the setting of whether or not to replace the public key.

Update the setting of whether or not to replace the public key.

 ConnectionProvider
   ...
   .setAllowPublicKeyRetrieval(true)

Value parameters

allowPublicKeyRetrieval

Whether to replace the public key

Attributes

Source
ConnectionProvider.scala
def setDatabase(database: String): ConnectionProvider[F, A]

Update the database to be connected.

Update the database to be connected.

 ConnectionProvider
   ...
   .setDatabase("database")

Value parameters

database

Database name to connect to

Attributes

Source
ConnectionProvider.scala
def setDatabaseTerm(databaseTerm: DatabaseTerm): ConnectionProvider[F, A]

Update whether the JDBC term “catalog” or “schema” is used to refer to the database in the application.

Update whether the JDBC term “catalog” or “schema” is used to refer to the database in the application.

 ConnectionProvider
   ...
   .setDatabaseTerm(DatabaseMetaData.DatabaseTerm.SCHEMA)

Value parameters

databaseTerm

The JDBC terms DatabaseMetaData.DatabaseTerm.CATALOG and DatabaseMetaData.DatabaseTerm.SCHEMA are used to refer to the database.

Attributes

Source
ConnectionProvider.scala
def setDebug(debug: Boolean): ConnectionProvider[F, A]

Update the setting of whether or not to output the log of packet communications for connection processing.

Update the setting of whether or not to output the log of packet communications for connection processing.

Default is false.

 ConnectionProvider
   ...
   .setDebug(true)

Value parameters

debug

Whether packet communication logs are output or not

Attributes

Source
ConnectionProvider.scala
def setHost(host: String): ConnectionProvider[F, A]

Update the host information of the database to be connected.

Update the host information of the database to be connected.

 ConnectionProvider
   ...
   .setHost("127.0.0.1")

Value parameters

host

Host information of the database to be connected

Attributes

Source
ConnectionProvider.scala
def setLogHandler(handler: LogHandler[F]): ConnectionProvider[F, A]

Update handler to output execution log of processes using connections.

Update handler to output execution log of processes using connections.

 ConnectionProvider
   ...
   .setLogHandler(consoleLogger)

Value parameters

handler

Handler for outputting logs of process execution using connections.

Attributes

Source
ConnectionProvider.scala
def setPassword(password: String): ConnectionProvider[F, A]

Update the password information of the database to be connected.

Update the password information of the database to be connected.

 ConnectionProvider
   ...
   .setPassword("password")

Value parameters

password

Password information of the database to be connected

Attributes

Source
ConnectionProvider.scala
def setPort(port: Int): ConnectionProvider[F, A]

Update the port information of the database to be connected.

Update the port information of the database to be connected.

 ConnectionProvider
   ...
   .setPort(3306)

Value parameters

port

Port information of the database to be connected

Attributes

Source
ConnectionProvider.scala
def setReadTimeout(readTimeout: Duration): ConnectionProvider[F, A]

Update the read timeout value.

Update the read timeout value.

 ConnectionProvider
   ...
   .setReadTimeout(Duration.Inf)

Value parameters

socketOptions

Read timeout value

Attributes

Source
ConnectionProvider.scala
def setSSL(ssl: SSL): ConnectionProvider[F, A]

Update whether SSL communication is used.

Update whether SSL communication is used.

 ConnectionProvider
   ...
   .setSSL(SSL.Trusted)

Value parameters

ssl

SSL set value. Changes the way certificates are operated, etc.

Attributes

Source
ConnectionProvider.scala

Update socket options for TCP/UDP sockets.

Update socket options for TCP/UDP sockets.

 ConnectionProvider
   ...
   .setSocketOptions(List(SocketOption.noDelay(true)))

Value parameters

socketOptions

List of socket options for TCP/UDP sockets

Attributes

Source
ConnectionProvider.scala
def setTracer(tracer: Tracer[F]): ConnectionProvider[F, A]

Update tracers to output metrics.

Update tracers to output metrics.

 ConnectionProvider
   ...
   .setTracer(Tracer.noop[IO])

Value parameters

handler

Tracer to output metrics

Attributes

Source
ConnectionProvider.scala
def setUser(user: String): ConnectionProvider[F, A]

Update the user information of the database to be connected.

Update the user information of the database to be connected.

 ConnectionProvider
   ...
   .setUser("root")

Value parameters

user

User information of the database to be connected

Attributes

Source
ConnectionProvider.scala
def withAfter(after: (A, Connection[F]) => F[Unit]): ConnectionProvider[F, A]

Add any process to be performed before disconnecting the connection.

Add any process to be performed before disconnecting the connection.

 val after = ???

 ConnectionProvider
   ...
   .withAfter(after)

Value parameters

after

Arbitrary processing to be performed before disconnecting

Attributes

Source
ConnectionProvider.scala
def withBefore[B](before: (Connection[F]) => F[B]): ConnectionProvider[F, B]

Add an optional process to be executed immediately after connection is established.

Add an optional process to be executed immediately after connection is established.

 val before = ???

 ConnectionProvider
   ...
   .withBefore(before)

Type parameters

B

Value returned after the process is executed. This value can be passed to the After process.

Value parameters

before

Arbitrary processing to be performed immediately after connection is established

Attributes

Source
ConnectionProvider.scala
def withBeforeAfter[B](before: (Connection[F]) => F[B], after: (B, Connection[F]) => F[Unit]): ConnectionProvider[F, B]

Add optional processing to be performed immediately after establishing a connection and before disconnecting.

Add optional processing to be performed immediately after establishing a connection and before disconnecting.

The order of processing is as follows.

 1. connection establishment
 2. before operation
 3. Processing using connections. Any processing used primarily in the operation of an application.
 4. after operation
 5. Disconnection
 val before = ???
 val after = ???

 ConnectionProvider
   ...
   .withBeforeAfter(before, after)

Type parameters

B

Value returned after the process is executed. This value can be passed to the After process.

Value parameters

after

Arbitrary processing to be performed before disconnecting

before

Arbitrary processing to be performed immediately after connection is established

Attributes

Source
ConnectionProvider.scala

Inherited and Abstract methods

Handler for outputting logs of process execution using connections.

Handler for outputting logs of process execution using connections.

Attributes

Inherited from:
Provider
Source
Provider.scala
def use[A](f: (Connection[F]) => F[A]): F[A]

Allocates a resource and supplies it to the given function. The resource is released as soon as the resulting F[A] is completed, whether normally or as a raised error.

Allocates a resource and supplies it to the given function. The resource is released as soon as the resulting F[A] is completed, whether normally or as a raised error.

Type parameters

A

the result of applying [F] to

Value parameters

f

the function to apply to the allocated resource

Attributes

Inherited from:
Provider
Source
Provider.scala