ldbc
Members list
Type members
Classlikes
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 Objecttrait Matchableclass Any
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 Objecttrait Matchableclass Any
Deprecated classlikes
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 Objecttrait Matchableclass Any
Types
Attributes
- Source
- DBIO.scala