Home

Awesome

clickhouse-go-rows-utils Go Reference Lint Test

Library that simplify working with rows in clickhouse-go.

Install

go get github.com/EpicStep/clickhouse-go-rows-utils

Documentation

Documentation for all functions available at pkg.go.dev

Usage example

package main

import (
	"context"
	
	rowsutils "github.com/EpicStep/clickhouse-go-rows-utils"
)

func main() {
	// connect to database.
	rows, err := db.Query(context.Background(), "SELECT 1")
	if err != nil {
		panic(err)
	}
	
	err = rowsutils.ForEachRow(rows, func(row rowsutils.CollectableRow) error {
		// scan your rows or do other work.
		return nil
	})
	if err != nil {
		panic(err)
	}
}