DuckDBIO
com.softinio.duck4s.effect.DuckDBIO
object DuckDBIO
Cats-effect integration for duck4s, providing cats.effect.Resource-based connection management and fs2.Stream-based result set streaming.
All JDBC calls are wrapped in cats.effect.IO.blocking to avoid blocking the cats-effect thread pool. Errors are raised as DuckDBException rather than returned as Either values.
Attributes
- Note
-
DuckDB connections are NOT thread-safe. Do not share a single connection across fibers. Use
duplicate()or open separate connections per fiber. - Example
-
import com.softinio.duck4s.effect.* val program: IO[Unit] = DuckDBIO.connect().use { conn => for _ <- conn.executeUpdateIO("CREATE TABLE t (id INTEGER)") _ <- conn.executeUpdateIO("INSERT INTO t VALUES (1)") rows <- DuckDBIO.stream(conn, "SELECT id FROM t")(_.getInt("id")).compile.toList _ <- IO(println(rows)) yield () } - Graph
-
- Supertypes
- Self type
-
DuckDBIO.type
Members list
In this article