From b6daafe95285ce77f038ae27cb042e06db0f92c4 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 14 Apr 2026 16:49:59 +0100 Subject: [PATCH] feat(store): DuckDB.Conn() accessor for streaming row iteration Conn() *sql.DB accessor on store.DuckDB. The higher-level helpers (Exec, QueryRowScan, QueryRows) don't cover streaming row iteration patterns that go-ml needs for its training/eval pipelines. Co-Authored-By: Virgil --- duckdb.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/duckdb.go b/duckdb.go index 968a174..29d7514 100644 --- a/duckdb.go +++ b/duckdb.go @@ -98,6 +98,17 @@ func (db *DuckDB) Path() string { return db.path } +// Conn returns the underlying *sql.DB connection. Prefer the typed helpers +// (Exec, QueryRowScan, QueryRows) when possible; this accessor exists for +// callers that need streaming row iteration or transaction control. +// +// Usage example: +// +// rows, err := db.Conn().Query("SELECT id, name FROM models WHERE kind = ?", "lem") +func (db *DuckDB) Conn() *sql.DB { + return db.conn +} + // Exec executes a query without returning rows. // // Usage example: