Categorygithub.com/EpicStep/clickhouse-go-rows-utils
modulepackage
1.0.0
Repository: https://github.com/epicstep/clickhouse-go-rows-utils.git
Documentation: pkg.go.dev

# README

clickhouse-go-rows-utils Go Reference Lint Test

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)
	}
}

# Packages

Package mock is a generated GoMock package.

# Functions

AppendRows iterates through rows, calling fn for each row, and appending the results into a slice of T.
CollectRows iterates through rows, calling fn for each row, and collecting the results into a slice of T.
ForEachRow iterates through rows, calling fn for each row.

# Interfaces

CollectableRow is the subset of Rows methods that a RowToFunc is allowed to call.

# Type aliases

ForEachRowFunc calls at each row.
RowToFunc is a function that scans or otherwise converts row to a T.