Skip to content

Instantly share code, notes, and snippets.

@kavirajk
Created November 7, 2025 11:56
Show Gist options
  • Save kavirajk/d824eb158ba278c962ab11e976f547f5 to your computer and use it in GitHub Desktop.
Save kavirajk/d824eb158ba278c962ab11e976f547f5 to your computer and use it in GitHub Desktop.
unknown_settings ClickHouse
package main
import (
"context"
"github.com/ClickHouse/clickhouse-go/v2"
)
func main() {
conn, err := clickhouse.Open(&clickhouse.Options{
Addr: []string{"localhost:8123"},
Protocol: clickhouse.HTTP,
// Settings: clickhouse.Settings{
// "custom_setting": clickhouse.CustomSetting{"custom_value"},
// },
Compression: &clickhouse.Compression{
Method: clickhouse.CompressionLZ4,
},
})
if err != nil {
panic(err)
}
row := conn.QueryRow(context.Background(), "SELECT getSetting('custom_non_existing_setting')")
if row.Err() != nil {
panic(row.Err())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment