clickhouse

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnNotFound = errors.New("no connection in context")

Functions

func Close

func Close()

Close closes a connection to the clickhouse database (if one exists). It panics if any error occurs.

func FromContext

func FromContext(ctx context.Context) (clickhouse.Conn, error)

FromContext extracts the clickhouse connection instance from the given context.

Returns the connection and an error if one does not exist.

func Initialize

func Initialize() error

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware to auto-inject the clickhouse connection instance in a request's context.

Ensure Initialize has been called before using this middleware.

func WithContext

func WithContext(ctx context.Context) context.Context

WithContext returns a new context with the clickhouse connection instance.

Ensure Initialize has been called before using this function.

To extract the clickhouse connection use the FromContext function.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL