Skip to main content

Introduction

The clickhouse-go client provides two API interfaces for communicating with ClickHouse:

  • ClickHouse client-specific API
  • database/sql standard - generic interface around SQL databases provided by Golang.

While the database/sql provides a database-agnostic interface, allowing developers to abstract their data store, it enforces some typing and query semantics that impact performance. For this reason, the client-specific API should be used where performance is important. However, users who wish to integrate ClickHouse into tooling, which supports multiple databases, may prefer to use the standard interface.

Both interfaces encode data using the native format and native protocol for communication. Additionally, the standard interface supports communication over HTTP.

Native formatNative protocolHTTP protocolBulk write supportStruct marshalingCompressionQuery Placeholders
ClickHouse API
database/sql API