diff --git a/statement.go b/statement.go index 87116524..606255f8 100644 --- a/statement.go +++ b/statement.go @@ -231,10 +231,12 @@ func (s *stmt) execute(ctx context.Context, args []driver.NamedValue) (*C.duckdb if ctx.Err() != nil { return nil, ctx.Err() } + dbErr := C.GoString(C.duckdb_result_error(&res)) C.duckdb_destroy_result(&res) return nil, errors.New(dbErr) } + return &res, nil }