Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/clickhouse-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ if err = conn.QueryRow(ctx, "SELECT sleep(3)").Scan(); err == nil {
ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(-time.Second))
defer cancel()
if err := conn.Ping(ctx); err == nil {
return fmt.Errorf("expected deadline exceeeded")
return fmt.Errorf("expected deadline exceeded")
}

// set a query id to assist tracing queries in logs e.g. see system.query_log
Expand Down
2 changes: 1 addition & 1 deletion docs/data-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The standard `database/sql` interface should support the same types as the Click

### Date/DateTime {#datedatetime}

The ClickHouse go client supports the `Date`, `Date32`, `DateTime`, and `DateTime64` date/datetime types. Dates can be inserted as a string in the format `2006-01-02` or using the native go `time.Time{}` or `sql.NullTime`. DateTimes also support the latter types but require strings to be passed in the format `2006-01-02 15:04:05` with an optional timezone offset e.g. `2006-01-02 15:04:05 +08:00`. `time.Time{}` and `sql.NullTime` are both supported at read time as well as any implementation of of the `sql.Scanner` interface.
The ClickHouse go client supports the `Date`, `Date32`, `DateTime`, and `DateTime64` date/datetime types. Dates can be inserted as a string in the format `2006-01-02` or using the native go `time.Time{}` or `sql.NullTime`. DateTimes also support the latter types but require strings to be passed in the format `2006-01-02 15:04:05` with an optional timezone offset e.g. `2006-01-02 15:04:05 +08:00`. `time.Time{}` and `sql.NullTime` are both supported at read time as well as any implementation of the `sql.Scanner` interface.

Handling of timezone information depends on the ClickHouse type and whether the value is being inserted or read:

Expand Down
2 changes: 1 addition & 1 deletion docs/database-sql-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ if err = conn.QueryRowContext(ctx, "SELECT sleep(3)").Scan(); err == nil {
ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(-time.Second))
defer cancel()
if err := conn.PingContext(ctx); err == nil {
return fmt.Errorf("expected deadline exceeeded")
return fmt.Errorf("expected deadline exceeded")
}

// set a query id to assist tracing queries in logs e.g. see system.query_log
Expand Down
2 changes: 1 addition & 1 deletion examples/clickhouse_api/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func UseContext() error {
ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(-time.Second))
defer cancel()
if err := conn.Ping(ctx); err == nil {
return fmt.Errorf("expected deadline exceeeded")
return fmt.Errorf("expected deadline exceeded")
}

// set a query id to assist tracing queries in logs e.g. see system.query_log
Expand Down
2 changes: 1 addition & 1 deletion examples/std/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func UseContext() error {
ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(-time.Second))
defer cancel()
if err := conn.PingContext(ctx); err == nil {
return fmt.Errorf("expected deadline exceeeded")
return fmt.Errorf("expected deadline exceeded")
}

// set a query id to assist tracing queries in logs e.g. see system.query_log
Expand Down
Loading