ldbc

package ldbc

Members list

Packages

package ldbc.free
package ldbc.logging

Type members

Classlikes

trait Connector[F[_]]

Connector trait for managing database connections and executing DBIO actions.

Connector trait for managing database connections and executing DBIO actions.

Type parameters

F

the effect type

Attributes

Source
Connector.scala
Supertypes
class Object
trait Matchable
class Any
trait DataSource[F[_]]

A factory for database connections that provides connections as managed resources.

A factory for database connections that provides connections as managed resources.

DataSource is a fundamental abstraction in ldbc that encapsulates the logic for establishing database connections. It provides a uniform interface for obtaining connections regardless of the underlying implementation (JDBC, native MySQL protocol, etc.).

Implementations of this trait are responsible for:

  • Connection pooling (if applicable)
  • Connection configuration and initialization
  • Resource lifecycle management
  • Error handling during connection establishment

The connections are provided as cats.effect.Resource instances, ensuring that:

  • Connections are properly initialized before use
  • Resources are cleaned up when no longer needed
  • Connection leaks are prevented through automatic resource management

Type parameters

F

the effect type (e.g., IO, Future, etc.) that wraps the operations

Attributes

See also

ldbc.connector.MySQLDataSource for the pure Scala implementation

jdbc.connector.MySQLDataSource for the JDBC-based implementation

Example
// Using a DataSource to execute database operations
val dataSource: DataSource[IO] = MySQLDataSource.fromConfig(config)
val result: IO[List[User]] = dataSource.getConnection.use { connection =>
 sql"SELECT * FROM users".query[User].to[List].run(connection)
}
Source
DataSource.scala
Supertypes
class Object
trait Matchable
class Any

Deprecated classlikes

trait Provider[F[_]]

Trait for aggregating settings for building connections and providing connections to users.

Trait for aggregating settings for building connections and providing connections to users.

Type parameters

F

the effect type

Attributes

Deprecated
true
Source
Provider.scala
Supertypes
class Object
trait Matchable
class Any

Types

type DBIO[A] = Free[ConnectionOp, A]

Attributes

Source
DBIO.scala